Skip to content

Instantly share code, notes, and snippets.

@nicokruger
Created March 4, 2012 07:45
Show Gist options
  • Save nicokruger/1971149 to your computer and use it in GitHub Desktop.
Save nicokruger/1971149 to your computer and use it in GitHub Desktop.
js-proto-deprecated
var NotAuthenticated = function () {
this.name = "Not authenticated";
Error.call(this, "Not authenticated");
Error.captureStackTrace(this, arguments.callee);
};
NotAuthenticated.prototype.__proto__ = Error.prototype;
... later on ....
if (error instanceof NotAuthenticated) {
// blablabla
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment