Skip to content

parseErrorResponse

parseErrorResponse(response, body?): Error

Defined in: src/http-api/utils.ts:81

Attempt to turn an HTTP error response into a Javascript Error.

If it is a JSON response, we will parse it into a DigitalWorldError. Otherwise we return a generic Error.

XMLHttpRequest | Response

response object

string

raw body of the response

Error