Skip to content

Instantly share code, notes, and snippets.

@kevinburkeshyp
Created April 15, 2015 21:05
Show Gist options
  • Save kevinburkeshyp/df30ac05d8e031f03cd8 to your computer and use it in GitHub Desktop.
Save kevinburkeshyp/df30ac05d8e031f03cd8 to your computer and use it in GitHub Desktop.
mailchimperror
MailchimpError = (function() {
function MailchimpError(status, name, error) {
this.message = error;
this.status = status;
this.name = name;
// handle the case where you don't invoke this with `new`
if (!(this instanceof MailchimpError)) {
return new MailchimpError(this.message);
}
Error.call(this);
Error.captureStackTrace(this, arguments.callee);
}
MailchimpError.prototype = Object.create(Error.prototype);
MailchimpError.prototype.constructor = MailchimpError;
return MailchimpError;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment