Skip to content

Commit

Permalink
Update response-error.js
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Nagy <ronagy@icloud.com>
  • Loading branch information
mertcanaltin and ronag committed Jun 17, 2024
1 parent e2321ec commit 7855225
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/interceptor/response-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class Handler extends DecoratorHandler {
const stackTraceLimit = Error.stackTraceLimit
Error.stackTraceLimit = 0
try {
err = Object.assign(createHttpError(this.#statusCode), {
err = Object.assign(new Error(http.STATUS_CODES[this.#statusCode]), {
statusCode: this.#statusCode,
status: this.#status,
reason: this.#body?.reason,
error: this.#body?.error,
headers: this.#headers,
Expand Down

0 comments on commit 7855225

Please sign in to comment.