Skip to content

Pretty print top level errors - #553

Open
selvmaya wants to merge 3 commits into
altsem:masterfrom
selvmaya:fix/use-error-display-over-debug
Open

Pretty print top level errors#553
selvmaya wants to merge 3 commits into
altsem:masterfrom
selvmaya:fix/use-error-display-over-debug

Conversation

@selvmaya

Copy link
Copy Markdown

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.

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