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

Bug Fix: terminate when error is encountered #497

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

rd4398
Copy link
Contributor

@rd4398 rd4398 commented Nov 7, 2024

This commit fixes a bug related to error message handling. The main will now exit using sys.exit(1) when there is an error

@rd4398 rd4398 requested a review from dhellmann November 7, 2024 18:22
@@ -249,7 +250,7 @@ def invoke_main() -> None:
) # log the full traceback details to the debug log file, if any
logger.error(f"ERROR: {err}")
if _DEBUG:
raise
sys.exit(1)
Copy link
Member

Choose a reason for hiding this comment

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

This isn't quite what we want.

We always want the exit with an error if there's an exception. When _DEBUG is set, then we want to raise the exception again to get the traceback. So, I think we want something like this

Suggested change
sys.exit(1)
raise
sys.exit(1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay. Pushed changes again

@mergify mergify bot merged commit 1a859ea into python-wheel-build:main Nov 7, 2024
71 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.

2 participants