Skip to content

Instantly share code, notes, and snippets.

@AvianFlu
Created August 4, 2011 01:05
Show Gist options
  • Save AvianFlu/1124283 to your computer and use it in GitHub Desktop.
Save AvianFlu/1124283 to your computer and use it in GitHub Desktop.
function AuthFailed(msg){
this.name = 'AuthFailed';
this.message = msg;
Error.call(this, msg);
Error.captureStackTrace(this, arguments.callee);
}
AuthFailed.prototype.__proto__ = Error.prototype;
var err = new AuthFailed('test error');
console.log(err instanceof AuthFailed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment