Skip to content

Instantly share code, notes, and snippets.

@ziedHamdi
Created August 5, 2022 13:17
Show Gist options
  • Save ziedHamdi/fd213d6fc821760ed04cea73ad1ead0d to your computer and use it in GitHub Desktop.
Save ziedHamdi/fd213d6fc821760ed04cea73ad1ead0d to your computer and use it in GitHub Desktop.
import ExtendableError from './ExtendableError'
import {error} from "winston";
const AuthenticationErrors = {
NOT_AUTHENTICATED: 401,
BAD_CREDENTIALS: 402
}
class AuthenticationError extends ExtendableError {
static errors = AuthenticationErrors
constructor(message, code) {
super(message, code ?? AuthenticationErrors.NOT_AUTHENTICATED);
}
}
export default AuthenticationError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment