Optional causeThe full Response object from the failed request
Use this to access response headers or read the response body:
const body = await error.response.text();
const contentType = error.response.headers.get('content-type');
Optional stackHTTP status code from the failed response
Error thrown when an HTTP request fails
This error is thrown by HttpClient methods when the server responds with an error status code (4xx or 5xx).
Example