Created
August 28, 2022 09:06
-
-
Save arifsetyawan/e41bc1a9695afc30fc294f313475cb25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CustomError } from "./custom-error"; | |
export class BadRequestError extends CustomError { | |
statusCode = 400; | |
reason = 'something went wrong'; | |
constructor(public message: string) { | |
super(message); | |
Object.setPrototypeOf(this, BadRequestError.prototype); | |
} | |
serializeError() { | |
return [ | |
{ message: this.message } | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment