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

[Improvement]: Better error message when project is not found in gateway #1397

Closed
jonaro00 opened this issue Nov 16, 2023 · 2 comments · Fixed by #1452
Closed

[Improvement]: Better error message when project is not found in gateway #1397

jonaro00 opened this issue Nov 16, 2023 · 2 comments · Fixed by #1452
Labels
Contribution Wanted The community is welcome to collaborate on this issue Good First Issue Good for newcomers S-Accepted This will be worked on T-Improvement Improvement or addition to existing features

Comments

@jonaro00
Copy link
Member

jonaro00 commented Nov 16, 2023

Describe the improvement

To improve the error message "project not found" to something like "project 'blablah' not found", it needs a little refactor.
Start with turning ProjectNotFound into a tuple struct ProjectNotFound(ProjectName).

Then, go through all usages of this variant, and add the project name into it:

  • In ScopedUser extractor, its local variable is called scope.
  • The 3 usages of ProjectNotFound in gateway's proxy.rs can be handled like this:
    • 1st one: Replace with BadHost
    • 2nd one: Replace with InvalidProjectName
    • 3rd one: Replace with CustomDomainNotFound
  • The rest should be straight forward.

After this change, calling cargo r -p cargo-shuttle -- project status --name unusedprojectname against the local stack should give the project name back in the error.


Feel free to comment on this issue if you want to work on it!

@jonaro00 jonaro00 added T-Improvement Improvement or addition to existing features Good First Issue Good for newcomers Contribution Wanted The community is welcome to collaborate on this issue S-Accepted This will be worked on labels Nov 16, 2023
@jonaro00 jonaro00 changed the title [Improvement]: Better error message when cargo-shuttle does not find workspace/package [Improvement]: Better error message when project is not found in gateway Nov 17, 2023
@selectiveduplicate
Copy link
Contributor

Hi! I'd like to work on this one if that's okay.

@orhun
Copy link
Contributor

orhun commented Nov 18, 2023

Sure, go ahead @selectiveduplicate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution Wanted The community is welcome to collaborate on this issue Good First Issue Good for newcomers S-Accepted This will be worked on T-Improvement Improvement or addition to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants