Esri/arcgis-rest-js

CompleteOAuth2 does not catch license type error

Ouverte

#1 080 ouverte le 1 mars 2023

 (0 commentaire) (0 réaction) (1 personne assignée)TypeScript (126 forks)auto 404
help wanted

Métriques du dépôt

Stars
 (389 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

Describe the bug

When calling completeOAuth2, I cannot catch the error that occurs when a user does not have a sufficient user license. This makes it impossible for me to handle this error and I am not sure why the error is breaking out of the try catch

Reproduction

try {
    const res = ArcGISIdentityManager.completeOAuth2(JSON.parse(opts));
} catch {
    console.log('Error not being caught');
}

Logs

ArcGISIdentityManager.ts:472 Uncaught (in promise) 
ArcGISAuthError: invalid_request: You do not have a sufficient user license type to access this application.
    at win.addEventListener.once (ArcGISIdentityManager.ts:472:31)
    at reportError (chunk-MWYRUQLI.js:924:20)
    at ArcGISIdentityManager.completeOAuth2 (chunk-MWYRUQLI.js:975:14)
    at Authenticate.tsx:28:41

System Info

Binaries:
    Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.13.0/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
    Firefox: 109.0.1
  npmPackages:
    @esri/arcgis-rest-request: ^4.1.1 => 4.1.1

Additional Information

No response

Guide contributeur