mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
22 lines
491 B
JavaScript
22 lines
491 B
JavaScript
class NotFoundError extends Error {
|
|
constructor(text, ...args) {
|
|
super(...args);
|
|
Error.captureStackTrace(this, NotFoundError);
|
|
this.name = 'NotFound';
|
|
this.text = text;
|
|
this.status = 404;
|
|
}
|
|
}
|
|
|
|
class BadRequestError extends Error {
|
|
constructor(text, ...args) {
|
|
super(...args);
|
|
Error.captureStackTrace(this, NotFoundError);
|
|
this.name = 'BadRequest';
|
|
this.text = text;
|
|
this.status = 400;
|
|
}
|
|
}
|
|
|
|
module.exports = { NotFoundError, BadRequestError };
|