Skip to content
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

More informative error handling #37

Open
dchiquito opened this issue Jul 28, 2021 · 0 comments
Open

More informative error handling #37

dchiquito opened this issue Jul 28, 2021 · 0 comments

Comments

@dchiquito
Copy link

dchiquito commented Jul 28, 2021

If the authorizationServerBaseUrl argument passed to OauthClient is not a complete URL, no exception will be thrown until the openid RedirectRequestHandler attempts to build a new URL(...) object out of it. Sadly, the error is swallowed by this try/catch:

try {
this.token = await this.oauthFacade.finishLogin();
} catch {
// Most likely, there is no pending Authorization flow.
// Possibly, there is an Authorization failure, which will be emitted to the
// console, but doesn't need to be fatal, since this can just proceed with no token.
}

Either an earlier check for this malformed user input or a more specific catch would have saved me a few hours of debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant