From d7f63ca5c066a6ae7f6c8ea970e2c031dfbe93c4 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Fri, 16 Aug 2024 18:24:11 +0200 Subject: [PATCH] fix: instantiation of ResponseError, pass headers and data correctly --- lib/interceptor/response-error.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/interceptor/response-error.js b/lib/interceptor/response-error.js index 3ded9c87fb7..dee3cc8e1a9 100644 --- a/lib/interceptor/response-error.js +++ b/lib/interceptor/response-error.js @@ -65,7 +65,10 @@ class Handler extends DecoratorHandler { const stackTraceLimit = Error.stackTraceLimit Error.stackTraceLimit = 0 try { - err = new ResponseError('Response Error', this.#statusCode, this.#headers, this.#body) + err = new ResponseError('Response Error', this.#statusCode, { + data: this.#body, + headers: this.#headers + }) } finally { Error.stackTraceLimit = stackTraceLimit }