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: handle terminal cleanup if main.rs panics from an Err #1660

Merged
merged 3 commits into from
Jan 18, 2025

Conversation

ClementTsang
Copy link
Owner

@ClementTsang ClementTsang commented Jan 18, 2025

Description

A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), please provide screenshots of the changes:

Looks like the panic hook doesn't get hit if main exits with an Err. This adds a catch for this scenario.

Tested by inserting a bail! into the main loop and seeing how it reacts.

Issue

If applicable, what issue does this address?

Closes: #

Testing

If relevant, please state how this was tested. All changes must be tested to work:

If this is a code change, please also indicate which platforms were tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, doc pages, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage)

@ClementTsang ClementTsang enabled auto-merge (squash) January 18, 2025 02:31
Copy link

codecov bot commented Jan 18, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.

Project coverage is 53.90%. Comparing base (873434b) to head (72f5134).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/lib.rs 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1660      +/-   ##
==========================================
+ Coverage   53.81%   53.90%   +0.09%     
==========================================
  Files         109      109              
  Lines       17905    17911       +6     
==========================================
+ Hits         9635     9655      +20     
+ Misses       8270     8256      -14     
Flag Coverage Δ
macos-14 37.36% <81.81%> (+0.09%) ⬆️
ubuntu-latest 56.27% <90.90%> (+0.09%) ⬆️
windows-2019 37.25% <72.72%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ClementTsang ClementTsang merged commit c970037 into main Jan 18, 2025
37 checks passed
@ClementTsang ClementTsang deleted the terminal_cleanup_err branch January 18, 2025 02:43
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.

1 participant