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(gateway): more descriptive project not found error #1452

Merged

Conversation

fatfingers23
Copy link
Contributor

@fatfingers23 fatfingers23 commented Dec 1, 2023

Description of change

Added the project name that is attempted to be used when looking up the status of a project in the error message.

I added the feature flag backend to the cargo-shuttle/Cargo.toml, because it appears it needed it for a test. I debated removing the feature flag from project.rs for what was required but decided to leave it. If this is not the desired outcome, please let me know, and I will update the PR

Closes #1397

How has this been tested? (if applicable)

Ran the command cargo run --bin cargo-shuttle -- project status --name ibetthisnameisnttaken as suggested in the issue and got the project name in the new error message.

@fatfingers23 fatfingers23 force-pushed the fix/descriptive-project-not-found branch from b83851e to 7698a96 Compare December 2, 2023 00:46
@jonaro00
Copy link
Member

jonaro00 commented Dec 5, 2023

Thanks for the PR!
Having backend enabled from cargo-shuttle is not desired, so if there's an easy refactor you can try it. You can also compromise and turn the enum type into ProjectNotFound(String) as the newtype isn't needed in the context of errors.

@fatfingers23 fatfingers23 force-pushed the fix/descriptive-project-not-found branch from 94090c9 to 97c7bb7 Compare December 5, 2023 18:18
@fatfingers23
Copy link
Contributor Author

Ended up taking the compromise and used String instead. Was the path with the least amount of changes and seemed what was appropriate since it's for an error message

Copy link
Member

@jonaro00 jonaro00 left a comment

Choose a reason for hiding this comment

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

LGTM

@jonaro00 jonaro00 changed the title Fix/descriptive project not found fix(gateway): more descriptive project not found error Dec 7, 2023
Copy link
Contributor

@oddgrd oddgrd left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@oddgrd oddgrd merged commit 850368e into shuttle-hq:main Dec 7, 2023
35 checks passed
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.

[Improvement]: Better error message when project is not found in gateway
3 participants