notificatiosn error handling

This commit is contained in:
Henry Jameson 2026-06-22 20:18:59 +03:00
commit f8a8951233
2 changed files with 14 additions and 17 deletions

View file

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