diff --git a/src/errors/NlicError.js b/src/errors/NlicError.js index 6b2eb93..bc5562e 100644 --- a/src/errors/NlicError.js +++ b/src/errors/NlicError.js @@ -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, + }; + } }