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

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

code: ArcGISTokenRequestErrorCodes

The error code for the request.

message

message: string

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

name

name: string

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

options

options: IRequestOptions

The options of the original request that caused the error

originalMessage

originalMessage: string

The error message return from the request.

response

response: any

The original JSON response the caused the error.

url

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.