Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.