Esri/arcgis-rest-js

CompleteOAuth2 does not catch license type error

Aberta

#1.080 aberto em 1 de mar. de 2023

 (0 comentário) (0 reação) (1 responsável)TypeScript (126 forks)auto 404
help wanted

Métricas do repositório

Stars
 (389 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

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

Guia do colaborador