Skip to content

Instantly share code, notes, and snippets.

@craftfortress
Created September 28, 2015 08:59
Show Gist options
  • Select an option

  • Save craftfortress/d286703cd79b725436f2 to your computer and use it in GitHub Desktop.

Select an option

Save craftfortress/d286703cd79b725436f2 to your computer and use it in GitHub Desktop.

Revisions

  1. craftfortress created this gist Sep 28, 2015.
    7 changes: 7 additions & 0 deletions Custom Error Javascript
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    function MyCustomError(message) {
    this.message = message;
    this.name = "MyCustomError";
    Error.captureStackTrace(this, MyCustomError);
    }
    MyCustomError.prototype = Object.create(Error.prototype);
    MyCustomError.prototype.constructor = MyCustomError;