Last active
August 20, 2022 16:01
-
-
Save tmatz/7a8f8cba88a83b11b0f7247761289060 to your computer and use it in GitHub Desktop.
javascript CustomError
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 class CustomError extends Error { | |
get name() { | |
return this.constructor.name | |
} | |
} |
Author
tmatz
commented
Jun 15, 2022
- no need to define constructor
It is difficult more than I expected.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment