Skip to content

feat(xtask): ✨ Exit with an error code when appropriate #2823

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

Merged
merged 2 commits into from
Jun 15, 2025

Conversation

zmerp
Copy link
Member

@zmerp zmerp commented May 9, 2025

No description provided.

Copy link
Collaborator

@The-personified-devil The-personified-devil left a comment

Choose a reason for hiding this comment

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

There's a couple more places that use panic as not an error condition but just as "print and exit with error code", so it might make sense to just refactor this out into a simple function (that simply takes a string so we don't need to use a macro) and use that instead.

@zmerp
Copy link
Member Author

zmerp commented Jun 15, 2025

@The-personified-devil

There's a couple more places that use panic as not an error condition but just as "print and exit with error code"

I used the common function for a few places in main.rs, there are other places in xtask that use panic but those do not need the help print. At the end of ci.rs and format.rs, those panics are internal errors, not invalid cmd format issue. In prepare_server_deps in dependencies.rs, those panics are already handled in main.rs, they are redundant to allow for exhaustive matching of conditions.

@zmerp zmerp merged commit ac236d8 into master Jun 15, 2025
9 checks passed
@zmerp zmerp deleted the xtask-error-exit branch June 15, 2025 17:22
zmerp added a commit that referenced this pull request Jun 27, 2025
* feat(xtask): ✨ Exit with an error code when appropriate

* Address review comments
zmerp added a commit that referenced this pull request Jun 30, 2025
* feat(xtask): ✨ Exit with an error code when appropriate

* Address review comments
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.

2 participants