-
-
Save gerzhan/7814fea24aac16c4136d944b5d9e91a4 to your computer and use it in GitHub Desktop.
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
function MyCustomError(message) { | |
this.message = message; | |
this.name = "MyCustomError"; | |
Error.captureStackTrace(this, MyCustomError); | |
} | |
// or util.inherits(MyCustomError, Error); | |
MyCustomError.prototype = Object.create(Error.prototype); | |
MyCustomError.prototype.constructor = MyCustomError; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment