Improved exception handling, started work on improving error messages for IP bans
This commit is contained in:
parent
7d3c31f0aa
commit
853f67fe15
15 changed files with 118 additions and 77 deletions
|
|
@ -19,8 +19,9 @@ const url = require("node:url");
|
|||
const validator = require('validator');
|
||||
|
||||
//Local Imports
|
||||
const regexUtils = require('../regexUtils');
|
||||
const media = require('../../app/channel/media/media');
|
||||
const media = require('../../app/channel/media/media.js');
|
||||
const regexUtils = require('../regexUtils.js');
|
||||
const loggerUtils = require('../loggerUtils.js')
|
||||
|
||||
module.exports.fetchMetadata = async function(link, title){
|
||||
//Parse link
|
||||
|
|
@ -52,7 +53,7 @@ module.exports.fetchMetadata = async function(link, title){
|
|||
if(!response.ok){
|
||||
//Scream and shout
|
||||
const errorBody = await response.text();
|
||||
throw new Error(`Internet Archive Error '${response.status}': ${errorBody}`);
|
||||
throw loggerUtils.exceptionSmith(`Internet Archive Error '${response.status}': ${errorBody}`, "queue");
|
||||
}
|
||||
|
||||
//Collect our metadata
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue