Constructor
new Error(options)
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source:
Members
(protected) code :String
Type:
- String
- Source:
(protected) context :Object
Free-form debug context (parsed response body, engine-specific debug info, etc.).
Type:
- Object
- Since:
- 1.5.0
- Source:
(protected) message :String
Type:
- String
- Source:
(protected) status :Number
HTTP status code if the error came from an HTTP response, otherwise null.
Type:
- Number
- Since:
- 1.5.0
- Source:
(protected) url :String
Request URL associated with the error, when applicable.
Type:
- String
- Since:
- 1.5.0
- Source:
Methods
getCode() → {String}
Get the code of the error.
- Source:
Returns:
code
- Type
- String
getContext() → {Object|null}
Get the free-form context object associated with the error, or null.
- Since:
- 1.5.0
- Source:
Returns:
context
- Type
- Object | null
getMessage() → {String}
Get the message of the error.
- Source:
Returns:
message
- Type
- String
getStatus() → {Number|null}
Get the HTTP status of the error, or null if not HTTP-originated.
- Since:
- 1.5.0
- Source:
Returns:
status
- Type
- Number | null
getUrl() → {String|null}
Get the request URL associated with the error, or null.
- Since:
- 1.5.0
- Source:
Returns:
url
- Type
- String | null