Skip to content

Instantly share code, notes, and snippets.

@arifsetyawan
Created August 28, 2022 09:06
Show Gist options
  • Save arifsetyawan/e41bc1a9695afc30fc294f313475cb25 to your computer and use it in GitHub Desktop.
Save arifsetyawan/e41bc1a9695afc30fc294f313475cb25 to your computer and use it in GitHub Desktop.
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