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 authored Jun 21, 2024
1 parent 124e0db commit d731d9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/interceptor/response-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class Handler extends DecoratorHandler {
}

onData (chunk) {
if (this.#statusCode >= 400) {
this.#body += this.#decoder?.decode(chunk, { stream: true }) ?? ''
} else {
if (this.#statusCode < 400) {
return this.#handler.onData(chunk)
}

this.#body += this.#decoder?.decode(chunk, { stream: true }) ?? ''
}

onComplete (rawTrailers) {
Expand Down

0 comments on commit d731d9f

Please sign in to comment.