A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/arcgis-rest-js/api-reference/arcgis-rest-request/ArcGISAuthError/ below:

ArcGISAuthError | ArcGIS REST JS

Class

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.

Parameters Parameter Type Default Notes 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

code

inherited

Class Property code: string | number

The error code returned from the request.

message

inherited

Class Property message: string

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

name

inherited

Class Property name: string

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

options

inherited

Class Property options: IRequestOptions

The options of the original request that caused the error

originalMessage

inherited

Class Property originalMessage: string

The errror message return from the request.

response

inherited

Class Property response: any

The original JSON response the caused the error.

url

inherited

Class Property url: 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