Skip to content

Instantly share code, notes, and snippets.

@arifsetyawan
Created August 28, 2022 08:53
Show Gist options
  • Save arifsetyawan/795a21617e3e1e4a0c1a4f14ab7d42d3 to your computer and use it in GitHub Desktop.
Save arifsetyawan/795a21617e3e1e4a0c1a4f14ab7d42d3 to your computer and use it in GitHub Desktop.
export abstract class CustomError extends Error {
abstract statusCode: number;
constructor(message: string) {
super(message);
Object.setPrototypeOf(this, CustomError.prototype);
}
abstract serializeError(): { message: string; field?: string }[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment