Skip to content

Commit d8d8ab7

Browse files
committed
Merge branch 'lpinca-fix/error-stack'
* lpinca-fix/error-stack: Create a `.stack` property on `FigoError` object.
2 parents 3136901 + 7f19f17 commit d8d8ab7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/errors.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
// - **error_description** (`String`) - the error description
88
//
99
var FigoError = function(error, error_description, errno) {
10+
Error.captureStackTrace(this, FigoError);
11+
1012
this.name = 'FigoError';
1113
this.error = error;
12-
this.error_description = error_description;
14+
this.message = this.error_description = error_description;
1315
this.errno = errno;
14-
this.stack = (new Error()).stack;
1516
};
1617
FigoError.prototype = Object.create(Error.prototype);
1718
FigoError.prototype.constructor = FigoError;
@@ -20,5 +21,5 @@ FigoError.prototype.toString = function() {
2021
};
2122

2223
module.exports = {
23-
FigoError: FigoError
24+
FigoError: FigoError
2425
};

0 commit comments

Comments
 (0)