This error is thrown when a request encounters an invalid token error. Requests that use ArcGISIdentityManager
or ApplicationCredentialsManager
in the authentication
option the authentication manager will automatically try to generate a fresh token using either ArcGISIdentityManager.refreshCredentials
or ApplicationCredentialsManager.refreshCredentials
. If the request with the new token fails you will receive an ArcGISAuthError
if refreshing the token fails you will receive an instance of ArcGISTokenRequestError
.
Use dark colors for code blocks Copy
1
2
3
4
5
6
7
8
9
10
11
12
request(someUrl, {
authentication: identityManager,
// some additional options...
}).catch(e => {
if(e.name === "ArcGISAuthError") {
console.log("Request with a new token failed you might want to have the user authorize again.")
}
if(e.name === "ArcGISTokenRequestError") {
console.log("There was an error refreshing the token you might want to have the user authorize again.")
}
})
Constructors constructor Class Constructor new ArcGISAuthError(message: string,âcode: string | number,âresponse?: any,âurl?: string,âoptions?: IRequestOptions): ArcGISAuthError
Create a new ArcGISAuthError
object.
message
string "AUTHENTICATION_ERROR"
The error message from the API
code
string | number "AUTHENTICATION_ERROR_CODE"
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 of the request
ReturnsÂArcGISAuthError
Properties
Hide inherited properties
Property Type Notes code
inherited
string | number
The error code returned from the request.
message
inherited
string
Formatted error message. See the Error
class for more details.
name
inherited
string
The name of this error. Will always be "ArcGISRequestError"
to conform with the Error
class.
options
inherited
IRequestOptions
The options of the original request that caused the error
originalMessage
inherited
string
The errror message return from the request.
response
inherited
any
The original JSON response the caused the error.
url
inherited
string
The URL of the original request that caused the error
codeinherited
Class Propertycode: string | number
The error code returned from the request.
messageinherited
Class Propertymessage: string
Formatted error message. See the Error
class for more details.
inherited
Class Propertyname: string
The name of this error. Will always be "ArcGISRequestError"
to conform with the Error
class.
inherited
Class Propertyoptions: IRequestOptions
The options of the original request that caused the error
originalMessageinherited
Class PropertyoriginalMessage: string
The errror message return from the request.
responseinherited
Class Propertyresponse: any
The original JSON response the caused the error.
urlinherited
Class Propertyurl: string
The URL of the original request that caused the error
Methods Method Returns retry(getSession,âretryLimit)
Promise<unknown>
retry Class Method retry(getSession:Â IRetryAuthError,âretryLimit:Â number): Promise<unknown>
Returns Promise<unknown>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4