π¨ Palette: Enhance anyhow nested error formatting in CLI#169
Conversation
Improved the CLI user experience by returning `std::process::ExitCode` from `main()` and manually iterating over the `anyhow::Error::chain()`. This replaces anyhow's default debug representation, which prints unstyled numbered lists for root causes, with a cleanly styled, red-bolded top-level error and indented (`β³`) nested causes. Co-authored-by: ffalcinelli <1167082+ffalcinelli@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #169 +/- ##
=======================================
Coverage 96.01% 96.01%
=======================================
Files 29 29
Lines 2834 2834
=======================================
Hits 2721 2721
Misses 113 113 β View full report in Codecov by Harness. π New features to boost your workflow:
|
π¨ Palette: [Improve anyhow error formatting]
π‘ What:
Updated
src/main.rsto stop returninganyhow::Result<()>and instead returnstd::process::ExitCode. By doing this, we gain control over theErrmatch, allowing us to manually iterate throughanyhow::Error::chain()using.enumerate().π― Why:
By default, anyhow's
Debugoutput for chained errors looks like a raw list:Which is unintuitive for end users. The new format is much cleaner.
πΈ Before/After:
Before:
After:
βΏ Ergonomics:
Errors are printed directly to
stderrwith appropriate ANSI color styling (via theconsolecrate), improving readability while maintaining Unix piping standards. Evaluates strictly toExitCode::FAILURE(1) upon error.PR created automatically by Jules for task 17220000211048694230 started by @ffalcinelli