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

feat(ux): Use human-panic to print better error messages in case rustic panics #1065

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

simonsan
Copy link
Contributor

human-panic is in so far valuable, that it can help us to better diagnose panics and errors in rustic as it prints better messages and even writes a log file with the stacktrace, that users can attach to their issues.

human-panic only displays a human-friendly panic message in release mode.

@simonsan simonsan added C-enhancement Category: New feature or request A-errors Area: error handling needs improvement A-ui-ux Area: Related to user interfaces and user experience labels Feb 15, 2024
@simonsan
Copy link
Contributor Author

Panic messages look like this:

Well, this is embarrassing.

rustic-rs had a problem and crashed. To help us diagnose the problem you can send us a crash report.    

We have generated a report file at "C:\Users\dailyuse\AppData\Local\Temp\report-4e0fac76-3a9a-413f-a017-241f919c2bce.toml". Submit an issue or email with the subject of "rustic-rs Crash Report" and include the report as an attachment.

- Authors: the rustic-rs team

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!

A report file looks like this:

name = "rustic-rs"
operating_system = "Windows 10.0.22631 (Windows 11 Professional) [64-bit]"
crate_version = "0.7.0"
explanation = '''
Panic occurred in file 'crates\core\src\storage\file.rs' at line 134
'''
cause = "not implemented: Handle error"
method = "Panic"
backtrace = """

   0: 0x7ff6a6ad1636 - <unresolved>
   1: 0x7ff6a6ad0835 - <unresolved>
   2: 0x7ff6a6af6396 - <unresolved>
   3: 0x7ff6a69be320 - <unresolved>
   4: 0x7ff6a69bf38a - <unresolved>
   5: 0x7ff6a69db7e9 - <unresolved>
   6: 0x7ff6a69d2516 - <unresolved>
   7: 0x7ff6a69db9ec - <unresolved>
   8: 0x7ff6a6c380dc - <unresolved>
   9: 0x7ffc8aff257d - BaseThreadInitThunk
  10: 0x7ffc8c8aaa58 - RtlUserThreadStart"""

…ic panics

human-panic is in so far valuable, that it can help us to better diagnose panics and errors in rustic as it prints better messages and even writes a log file with the stacktrace, that users can attach to their issues.
Copy link
Member

@aawsome aawsome left a comment

Choose a reason for hiding this comment

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

Maybe removing all places where rustic does panic is even better, but this helps of course with the UX.
LGTM!

@aawsome aawsome added this pull request to the merge queue Feb 16, 2024
Merged via the queue into rustic-rs:main with commit d20eaaa Feb 16, 2024
28 checks passed
@simonsan simonsan deleted the feat/error-ux branch February 16, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-errors Area: error handling needs improvement A-ui-ux Area: Related to user interfaces and user experience C-enhancement Category: New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants