shellphone.app/app/utils/errors.ts

23 lines
497 B
TypeScript
Raw Normal View History

2022-05-14 10:22:06 +00:00
export class AuthenticationError extends Error {
name = "AuthenticationError";
statusCode = 401;
constructor(message = "You must be logged in to access this") {
super(message);
}
}
export class ResetPasswordError extends Error {
name = "ResetPasswordError";
message = "Reset password link is invalid or it has expired.";
}
export class NotFoundError extends Error {
name = "NotFoundError";
statusCode = 404;
constructor(message = "This could not be found") {
super(message);
}
}