Skip to content

feat: pretty print top level errors - #553

Merged
altsem merged 4 commits into
altsem:masterfrom
selvmaya:fix/use-error-display-over-debug
Oct 26, 2026
Merged

altsem merged 4 commits into
altsem:masterfrom
selvmaya:fix/use-error-display-over-debug

Conversation

@selvmaya

Copy link
Copy Markdown
Contributor

There are already Display implementations for the top level crate::Error enum, but when running gitu it bubbles them up all the way to main, which makes rust debug print the Result: https://doc.rust-lang.org/src/std/process.rs.html#2684

This PR merely wraps main, pretty prints the error if one occurs, and explicitly returns an ExitCode (success/failure) depending on the result, instead of using the generic Termination implementation for Result<T: Termination, E: Debug>.

I assume this is probably closer to what was intended with the explicit Display implementation of crate::Error.

@altsem
altsem enabled auto-merge (rebase) October 26, 2026 21:03
@altsem
altsem disabled auto-merge October 26, 2026 21:03
@altsem altsem changed the title Pretty print top level errors feat: pretty print top level errors Oct 26, 2026
@altsem
altsem merged commit 0c1d7ca into altsem:master Oct 26, 2026
3 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