Skip to content

ArcGISRequestError

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.

Use dark colors for code blocksCopy
1
2
3
4
5
6
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);
  }
})
Inheritance: ArcGISRequestErrorError
Subclasses: ArcGISAuthError

Constructors

constructor

Class Constructor
new ArcGISRequestError(message?string, code?string | number, response?any, url?string, options?IRequestOptions): ArcGISRequestError

Create a new ArcGISRequestError object.

Parameters
ParameterTypeNotes
messagestring

The error message from the API

codestring | number

The error code from the API

responseany

The original response from the API that caused the error

urlstring

The original url of the request

optionsIRequestOptions

The original options and parameters of the request

Returns 
ArcGISRequestError

Properties

PropertyTypeNotes
codestring | number

The error code returned from the request.

messagestring

Formatted error message. See the Error class for more details.

namestring

The name of this error. Will always be "ArcGISRequestError" to conform with the Error class.

optionsIRequestOptions

The options of the original request that caused the error

originalMessagestring

The errror message return from the request.

responseany

The original JSON response the caused the error.

urlstring

The URL of the original request that caused the error

code

Class Property
code: string | number

The error code returned from the request.

message

Class Property
message: string

Formatted error message. See the Error class for more details.

name

Class Property
name: string

The name of this error. Will always be "ArcGISRequestError" to conform with the Error class.

options

Class Property
options: IRequestOptions

The options of the original request that caused the error

originalMessage

Class Property
originalMessage: string

The errror message return from the request.

response

Class Property
response: any

The original JSON response the caused the error.

url

Class Property
url: string

The URL of the original request that caused the error

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.