Skip to content

Commit 2442bd3

Browse files
committed
fix "Converting circular structure to JSON" error
1 parent 3e8b569 commit 2442bd3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/errors/NlicError.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,23 @@ export default class NlicError extends Error {
1010
this.isNlicError = true;
1111
this.isAxiosError = true;
1212
}
13+
14+
toJSON() {
15+
return {
16+
// Standard
17+
message: this.message,
18+
name: this.name,
19+
// Microsoft
20+
description: this.description,
21+
number: this.number,
22+
// Mozilla
23+
fileName: this.fileName,
24+
lineNumber: this.lineNumber,
25+
columnNumber: this.columnNumber,
26+
stack: this.stack,
27+
// Axios
28+
config: this.config,
29+
code: this.code,
30+
};
31+
}
1332
}

0 commit comments

Comments
 (0)