arcgis-rest-js icon indicating copy to clipboard operation
arcgis-rest-js copied to clipboard

CompleteOAuth2 does not catch license type error

Open am-maneaters opened this issue 1 year ago • 0 comments

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

am-maneaters avatar Mar 01 '23 18:03 am-maneaters