diff options
author | Adam Buczynski <adambuczynski@gmail.com> | 2016-07-27 12:54:31 +1200 |
---|---|---|
committer | Adam Buczynski <adambuczynski@gmail.com> | 2016-07-27 12:54:31 +1200 |
commit | bc6295358f4424e343ed9377cc7f0ffdb17dc98c (patch) | |
tree | eedc3c853fa30dcbd376cef0d2dafc43cae3c39e /lib/helpers | |
parent | d051d8f055631619f51719648f7e6e29005623fd (diff) | |
parent | ea4e9fd24a7cd715f24027cc34f588cc64597682 (diff) | |
download | sendgrid-nodejs-bc6295358f4424e343ed9377cc7f0ffdb17dc98c.zip sendgrid-nodejs-bc6295358f4424e343ed9377cc7f0ffdb17dc98c.tar.gz sendgrid-nodejs-bc6295358f4424e343ed9377cc7f0ffdb17dc98c.tar.bz2 |
Merge branch 'callback-function-signature' into eslint
Diffstat (limited to 'lib/helpers')
-rw-r--r-- | lib/helpers/error.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/helpers/error.js b/lib/helpers/error.js new file mode 100644 index 0000000..2beb886 --- /dev/null +++ b/lib/helpers/error.js @@ -0,0 +1,20 @@ +'use strict'; + +//Error constructor +function SendGridError(message) { + this.message = message; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + else { + this.stack = (new Error()).stack; + } +} + +//Extend prototype +SendGridError.prototype = new Error(); +SendGridError.prototype.constructor = SendGridError; +SendGridError.prototype.name = 'SendGridError'; + +//Export +module.exports = SendGridError; |