Skip to content

Instantly share code, notes, and snippets.

@craftfortress
Created September 28, 2015 08:59
Show Gist options
  • Save craftfortress/d286703cd79b725436f2 to your computer and use it in GitHub Desktop.
Save craftfortress/d286703cd79b725436f2 to your computer and use it in GitHub Desktop.
function MyCustomError(message) {
this.message = message;
this.name = "MyCustomError";
Error.captureStackTrace(this, MyCustomError);
}
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