Map an HTTP error response to one of the Error classes exported by this library.
the response metadata
the response body
the error message
an instance of the ClientHttpError subclass matching the response metadata status. If the response status is unkown, the generic ClientHttpError class is used.
const response = await fetch("https://example.org/resource");if (!response.ok) { const responseBody = await response.text(); throw handleErrorResponse(response, responseBody, "Fetch got error response");} Copy
const response = await fetch("https://example.org/resource");if (!response.ok) { const responseBody = await response.text(); throw handleErrorResponse(response, responseBody, "Fetch got error response");}
0.0.1
Map an HTTP error response to one of the Error classes exported by this library.