From 2442bd30b27cd1e17c649eeabf0284005f4ab71c Mon Sep 17 00:00:00 2001 From: Slava Rudkovskiy Date: Mon, 15 Jun 2020 12:04:25 +0300 Subject: [PATCH] fix "Converting circular structure to JSON" error --- src/errors/NlicError.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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, + }; + } }