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

fix: Handle no projects available #412

Merged
merged 3 commits into from
Sep 1, 2023
Merged

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Aug 31, 2023

This PR handles the uncaught crash when a user chose to log in but didn't yet create a project. In this case, we now print a message instructing users to create a new project first and then try running the wizard again.

I refactored all our clack-based wizards to use the getOrAskForProjectData helper so that we only have to handle this once.

For the Step-based wizards, I adjusted the error message with better instructions.

closes #400

@Lms24 Lms24 requested a review from lforst August 31, 2023 15:06
@Lms24 Lms24 self-assigned this Aug 31, 2023
@krystofwoldrich
Copy link
Member

Is this also an issue in the RN wizard?

@Lms24
Copy link
Member Author

Lms24 commented Sep 1, 2023

@krystofwoldrich good point! I checked and for RN (+ the other Step-based wizards) the SentryProjectSelector Step simply throws an error:

if (
_.has(answers, 'wizard.projects') &&
answers.wizard.projects.length === 0
) {
throw new Error('no projects');
}

I'm just gonna add a more verbose error message but leave the rest as is.

@Lms24 Lms24 merged commit 4b2f399 into master Sep 1, 2023
11 checks passed
@Lms24 Lms24 deleted the lms/fix-no-projects-available branch September 1, 2023 09:19
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

Successfully merging this pull request may close these issues.

TypeError when there's no projects to select from
3 participants