Skip to content

Commit

Permalink
feat: enhance err
Browse files Browse the repository at this point in the history
  • Loading branch information
metcoder95 committed Oct 25, 2023
1 parent 0850d3e commit 0fc9518
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/core/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,15 @@ class ResponseExceededMaxSizeError extends UndiciError {
}

class RequestRetryError extends UndiciError {
constructor (message, code, data) {
constructor (message, code, { headers, data }) {
super(message)
Error.captureStackTrace(this, RequestRetryError)
this.name = 'RequestRetryError'
this.message = message || 'Request retry error'
this.code = 'UND_ERR_REQ_RETRY'
this.statusCode = code
this.data = data ? data.toString() : undefined
this.data = data
this.headers = headers
}
}

Expand Down

0 comments on commit 0fc9518

Please sign in to comment.