Created
April 15, 2015 21:05
-
-
Save kevinburkeshyp/df30ac05d8e031f03cd8 to your computer and use it in GitHub Desktop.
mailchimperror
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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