Skip to content

Commit 96d4902

Browse files
authored
Merge pull request #93 from Travelport-Ukraine/dev
Added support for non-V8 environments
2 parents a7a6624 + 7295d06 commit 96d4902

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-errors-helpers",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Some helpers for better error handling in Node.js",
55
"main": "build/index.js",
66
"files": [

src/error-factory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ const errorFactory = (name, message, baseType) => {
1818
'if (p) {' +
1919
'this.causedBy = p;' +
2020
'}' +
21-
'Error.captureStackTrace(this, this.constructor);' +
21+
'if (Error.captureStackTrace) {' +
22+
'Error.captureStackTrace(this, this.constructor);' +
23+
'}' +
2224
'}';
2325
/* eslint-enable prefer-template */
2426

0 commit comments

Comments
 (0)