ArcGISTokenRequestError

Class

This error is thrown when ArcGISIdentityManager or ApplicationCredentialsManager fails to refresh a token or generate a new token for a request. Generally in this scenario the credentials are invalid for the request and the you should recreate the ApplicationCredentialsManageror prompt the user to authenticate again with ArcGISIdentityManager. See ArcGISTokenRequestErrorCodes for a more detailed description of the possible error codes.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
request(someUrl, {
  authentication: someAuthenticationManager
}).catch(e => {
  if(e.name === "ArcGISTokenRequestError") {
    // ArcGIS REST JS could not generate an appropriate token for this request
    // All credentials are likely invalid and the authentication process should be restarted
  }
})
Inheritance: ArcGISTokenRequestErrorError

Constructors

constructor

Class Constructor
new ArcGISTokenRequestError(messagestring, codeArcGISTokenRequestErrorCodes, response?any, url?string, options?IRequestOptions): ArcGISTokenRequestError

Create a new ArcGISTokenRequestError object.

Parameters
ParameterTypeDefaultNotes
message
string
"UNKNOWN_ERROR"

The error message from the API

code
ArcGISTokenRequestErrorCodes
...

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 
ArcGISTokenRequestError

Properties

PropertyTypeNotes

The error code for the request.

string

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

string

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

The options of the original request that caused the error

string

The error 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

code

Class Property
code: ArcGISTokenRequestErrorCodes

The error code for 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 "ArcGISTokenRequestError" 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 error 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.