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

Organize Errors in GitHub Auth and make sure no double prompting happens #180734

Merged
merged 2 commits into from Apr 24, 2023

Conversation

TylerLeonhardt
Copy link
Member

This mostly just moves some strings into variables... but this also fixes the GH Auth side of #180697 so you should only be asked once if you want to try a different way to log in.

This mostly just moves some strings into variables... but this also fixes the GH Auth side of #180697 so you should only be asked once if you want to try a different way to log in.
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) April 24, 2023 18:27
@TylerLeonhardt TylerLeonhardt self-assigned this Apr 24, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the April 2023 milestone Apr 24, 2023

const TIMED_OUT_ERROR = 'Timed out';
const CANCELLATION_ERROR = 'Cancelled';
const USER_CANCELLATION_ERROR = 'User Cancelled';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these strings ever end up in UI somewhere (e.g. an uncaught error) that gets bubbled up into an error modal? If so, could we make these a little more descriptive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They shouldn't. CANCELLATION_ERROR is thrown to extensions calling getSession({ createIfNone: true })... but the others are totally internal.

It's kinda been this unspoken contract that an extension can handle cancelation accordingly by checking for the error message Cancelled. It should be more apparent, but that's out of scope of this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some comments

@TylerLeonhardt TylerLeonhardt merged commit 1714f71 into main Apr 24, 2023
7 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/accessible-crocodile branch April 24, 2023 19:59
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants