summaryrefslogtreecommitdiffstats
path: root/lib/helpers/error.js
blob: 2beb886263a61ed63e04b6d86c583a878a495f1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;