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 ApplicationCredentialsManager
or prompt the user to authenticate again with ArcGISIdentityManager. See ArcGISTokenRequestErrorCodes for a more detailed description of
the possible error codes.
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
}
})Constructors
constructor
Class Constructornew ArcGISTokenRequestError(message: string, code: ArcGISTokenRequestErrorCodes, response?: any, url?: string, options?: IRequestOptions): ArcGISTokenRequestErrorCreate a new ArcGISTokenRequestError object.
Parameters
| Parameter | Type | Default | Notes |
|---|---|---|---|
message | string | " | 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
ArcGISTokenRequestErrorProperties
| Property | Type | Notes |
|---|---|---|
code | ArcGISTokenRequestErrorCodes | The error code for the request. |
message | string | Formatted error message. See the |
name | string | The name of this error. Will always be |
options | IRequestOptions | The options of the original request that caused the error |
originalMessage | string | The error message return from the request. |
response | any | The original JSON response the caused the error. |
url | string | The URL of the original request that caused the error |