self-review

This commit is contained in:
Henry Jameson 2026-06-26 14:42:01 +03:00
commit 9b53879e70
9 changed files with 8 additions and 29 deletions

View file

@ -13,9 +13,9 @@ function humanizeErrors(errors) {
export function StatusCodeError(statusCode, body, options, response) {
this.name = 'StatusCodeError'
this.statusCode = statusCode
this.statusText = body.error || body
this.statusText = body.error || body.errors || body
this.details = JSON && JSON.stringify ? JSON.stringify(body) : body
this.errorData = body.error
this.errorData = body.error || body.errors
this.message = this.statusCode + ' - ' + this.statusText
this.error = body // legacy attribute
this.options = options