Class
This represents a generic error from an ArcGIS endpoint. There will be details about the error in the ArcGISRequestError.message
, ArcGISRequestError.originalMessage
properties on the error. You
can also access the original server response at ArcGISRequestError.response
which may have additional details.
request(someUrl, someOptions).catch(e => {
if(e.name === "ArcGISRequestError") {
console.log("Something went wrong with the request:", e);
console.log("Full server response", e.response);
}
})
Constructors
constructor
Class Constructornew ArcGISRequestError(message?: string, code?: string | number, response?: any, url?: string, options?: IRequestOptions): ArcGISRequestError
Create a new ArcGISRequestError
object.
Parameters
Parameter | Type | Notes |
---|---|---|
message | string | The error message from the API |
code | string | number | The error code from the API |
response | any | The original response from the API that caused the error |
url | string | The original url of the request |
options | IRequestOptions | The original options and parameters of the request |
Returns
ArcGISRequestError
Properties
Property | Type | Notes |
---|---|---|
string | number | The error code returned from the request. | |
string | Formatted error message. See the | |
string | The name of this error. Will always be | |
The options of the original request that caused the error | ||
string | The errror message return from the request. | |
any | The original JSON response the caused the error. | |
string | The URL of the original request that caused the error |
message
Class Propertymessage: string
Formatted error message. See the Error
class for more details.
name
Class Propertyname: string
The name of this error. Will always be "ArcGISRequestError"
to conform with the Error
class.
options
Class Propertyoptions: IRequestOptions
The options of the original request that caused the error
code: string | number
The error code returned from the request.