class
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.
class HttpErrorResponse extends HttpResponseBase implements Error { constructor(init: { error?: any; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }) name: 'HttpErrorResponse' message: string error: any | null ok: false // inherited from common/http/HttpResponseBase constructor(init: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }, defaultStatus: number = 200, defaultStatusText: string = 'OK') headers: HttpHeaders status: number statusText: string url: string | null ok: boolean type: HttpEventType.Response | HttpEventType.ResponseHeader }
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.
|
init | object |
Property | Description |
---|---|
name: 'HttpErrorResponse' | Read-Only |
message: string | Read-Only |
error: any | null | Read-Only |
ok: false |
Read-Only Errors are never okay, even when the status code is in the 2xx success range. |
© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v11.angular.io/api/common/http/HttpErrorResponse