Skip to content

Commit

Permalink
fix(nodejs#3837): RetryHandler: support throwOnError
Browse files Browse the repository at this point in the history
  • Loading branch information
golyshevd committed Nov 15, 2024
1 parent f914e3d commit d214f73
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/handler/retry-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ class RetryHandler {
statusMessage
)
} else {
if (this.retryCount > this.retryOpts.maxRetries && this.opts.throwOnError === false) {
return this.handler.onHeaders(
statusCode,
rawHeaders,
resume,
statusMessage
)
}

this.abort(
new RequestRetryError('Request failed', statusCode, {
headers,
Expand Down

0 comments on commit d214f73

Please sign in to comment.