FCC-Project-URLShortener/scripts/utilities/errors.js
buzzcode2007 36cb74ac72 Update messaging errors
Should change the error name when a URL-related error is found
2025-03-23 07:49:43 +00:00

25 lines
No EOL
568 B
JavaScript
Executable file

class CustomErrors {}
CustomErrors.URL = class URL_Error extends Error {
constructor(message, URL) {
super((message) ? message : `invalid url`);
this.name = "URL Problem";
this.stack = URL;
};
}
CustomErrors.DBProblem = class DB_Error extends Error {
constructor(message) {
super(message);
this.name = "Database Problem"
}
}
CustomErrors.HashProblem = class DB_Error extends Error {
constructor(message) {
super(message);
this.name = "Hash Problem"
}
}
module.exports = {CustomErrors}