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): ArcGISTokenRequestError
Create a new ArcGISTokenRequestError
object.
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
message | string | "UNKNOWN_ | 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
Property | Type | Notes |
---|---|---|
The error code for 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 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 |
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 "ArcGISTokenRequestError"
to conform with the Error
class.
options
Class Propertyoptions: IRequestOptions
The options of the original request that caused the error
code: ArcGISTokenRequestErrorCodes
The error code for the request.