Created
December 8, 2017 23:05
-
-
Save abumalick/cde6e3f594b4f7ae8b51d453df8a9310 to your computer and use it in GitHub Desktop.
Custom Error with ES6 class
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
// https://stackoverflow.com/a/32750746/1673761 | |
class MyError extends Error { | |
constructor(message) { | |
super(message); | |
this.name = 'MyError'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment