Created
August 28, 2022 08:53
-
-
Save arifsetyawan/795a21617e3e1e4a0c1a4f14ab7d42d3 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
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