Created
March 7, 2019 15:50
-
-
Save oleersoy/19051447ea2ea59bcaa41fae71514e36 to your computer and use it in GitHub Desktop.
Is Error
This file contains hidden or 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
| /** | |
| * @param message The error message | |
| * @param value The value that violates the constraint | |
| * @param field The name of the field | |
| * @param type The expected type for the field | |
| * @param constraint The name of the constraint violated | |
| * @param code The application or module code for the error | |
| */ | |
| export class IsError extends Error { | |
| constructor( | |
| public message:string, | |
| public value: any, | |
| public field?:string, | |
| public type?: string, | |
| public constraint?: string, | |
| public code?:string) { | |
| super(message); | |
| this.name = 'IsError'; | |
| Object.setPrototypeOf(this, IsError.prototype); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment