-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure errors thrown when monitoring window are caught and handled #1113
Conversation
a9510b0
to
afaf7f8
Compare
@@ -34,6 +34,8 @@ export default C => | |||
return redirect | |||
? msalApp.acquireTokenRedirect(request) | |||
: msalApp.acquireTokenPopup(request); | |||
} else { | |||
console.error('Non-interactive error:', error.errorCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timeout errors were previously not bubbling up to the call site in the application.
@@ -1260,7 +1268,7 @@ export class UserAgentApplication { | |||
this.registerCallback(serverAuthenticationRequest.state, scope, resolve, reject); | |||
this.logger.infoPii("Navigate to:" + urlNavigate); | |||
frameHandle.src = "about:blank"; | |||
this.loadIframeTimeout(urlNavigate, frameName, scope); | |||
this.loadIframeTimeout(urlNavigate, frameName, scope).catch(error => reject(error)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why in some places we have if (reject)
after catching the error and sometimes not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm. Test manually once before dev release.
Currently, when
monitorWindowForHash
threw an error, it wasn't properly caught, which resulted in unhandled rejection errors (and the inability for apps to catch and handle these errors on their own). This PR ensures that these errors are caught, and properly passed up to the call site that initiate the request.