-
Notifications
You must be signed in to change notification settings - Fork 13
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(cli): avoid expected error backtrace #960
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the 📝 WalkthroughWalkthroughThe pull request introduces a minor modification to the logger configuration in the Changes
Note: Since this is a very simple configuration change that doesn't significantly alter the control flow or introduce a new feature, a sequence diagram is not necessary. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/meta-cli/src/main.rs (2)
Line range hint
95-120
: Consider improving upgrade check error handling.While the warning log for upgrade check failures is good, consider if users should be explicitly notified of upgrade availability, especially for critical updates.
if let Err(err) = runner.block_on(upgrade_check()) { - warn!("cannot check for update: {err}"); + eprintln!("Warning: Unable to check for updates: {err}"); + eprintln!("You may want to manually check for updates using `meta upgrade`"); }
124-127
: Consider enhancing error message formatting.While the error handling is correct, consider improving the error message formatting for better user experience:
if let Err(error) = result { - eprintln!("Error: {error}"); + eprintln!("\nError: {error}"); + eprintln!("\nFor more information, try running the command with --verbose"); std::process::exit(1); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/meta-cli/src/main.rs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
- GitHub Check: test-full
- GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
- GitHub Check: pre-commit
🔇 Additional comments (2)
src/meta-cli/src/main.rs (2)
93-93
: LGTM! Good separation of concerns.Introducing the
result
variable improves error handling by cleanly separating command processing from error handling.
122-122
: LGTM! Good default behavior.Printing help information when no command is provided follows CLI best practices and provides a good user experience.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #960 +/- ##
=======================================
Coverage 77.98% 77.98%
=======================================
Files 154 154
Lines 19082 19082
Branches 1929 1929
=======================================
Hits 14882 14882
Misses 4177 4177
Partials 23 23 ☔ View full report in Codecov by Sentry. |
@Yohe-Am Sorry, do we need some fancy output or is this enough? |
Hey, sorry but I found some more nuance on this ticket and had to change ghjk as well. So the panic section only seems to show up on explicit panics and not on Maybe there cli commands that aren't properly bubbling their errors? I wonder if we could enable more clippy lints for that or |
b294ee3
to
88f7b7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/meta-cli/src/logger.rs (1)
Line range hint
48-49
: Consider documenting the FIXME resolution criteria.The FIXME comment about tests already having an eyre_hook would benefit from additional context about:
- What conditions would allow this FIXME to be resolved
- Potential risks of having multiple hooks in tests
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/meta-cli/src/logger.rs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
- GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
- GitHub Check: test-full
- GitHub Check: pre-commit
🔇 Additional comments (2)
src/meta-cli/src/logger.rs (2)
33-33
: LGTM! The change aligns with the PR objective.Disabling the environment section helps reduce noise in error output for expected errors while maintaining essential information for debugging actual panics.
Line range hint
7-36
: Consider extending error configuration for better error handling.The current panic hook configuration could be enhanced to better distinguish between expected errors and actual panics. Consider adding configuration to:
- Customize backtrace behavior based on error type
- Add different panic sections for development vs production environments
Let's verify the current error handling patterns:
Migration notes
Summary by CodeRabbit