HttpErrorResponse
A response that represents an error or failure, either from a non-successful HTTP status, an error while executing the request, or some other failure which occurred during the parsing of the response.
constructor
HttpErrorResponse{ error?: any; headers?: HttpHeaders | undefined; status?: number | undefined; statusText?: string | undefined; url?: string | undefined; redirected?: boolean | undefined; }HttpErrorResponsename
"HttpErrorResponse"message
stringerror
anyok
falseErrors are never okay, even when the status code is in the 2xx success range.
headers
HttpHeadersAll response headers.
status
numberResponse status code.
statusText
stringTextual description of response status code, defaults to OK.
Do not depend on this.
url
string | nullURL of the resource retrieved, or null if not available.
type
HttpEventType.ResponseHeader | HttpEventType.ResponseType of the response, narrowed to either the full response or the header.
redirected
boolean | undefinedIndicates whether the HTTP response was redirected during the request.
This property is only available when using the Fetch API using withFetch()
When using the default XHR Request this property will be undefined
Description
A response that represents an error or failure, either from a non-successful HTTP status, an error while executing the request, or some other failure which occurred during the parsing of the response.
Any error returned on the Observable response stream will be
wrapped in an HttpErrorResponse to provide additional context about
the state of the HTTP layer when the error occurred. The error property
will contain either a wrapped Error object or the error response returned
from the server.