Skip to content

Commit

Permalink
fix "Converting circular structure to JSON" error
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rudkovskiy committed Jun 15, 2020
1 parent 3e8b569 commit 2442bd3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/errors/NlicError.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,23 @@ export default class NlicError extends Error {
this.isNlicError = true;
this.isAxiosError = true;
}

toJSON() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: this.config,
code: this.code,
};
}
}

0 comments on commit 2442bd3

Please sign in to comment.