-
Notifications
You must be signed in to change notification settings - Fork 337
Handle failed exit codes elegantly #799
Handle failed exit codes elegantly #799
Conversation
reason i'm looking at this is because of cargo-generate/cargo-generate#198 |
While we are at it, could we remove these redundant lines?
seems those lines are saying the same thing? |
Totally! |
"failed to execute `{}`: exited with {}", | ||
command_name, | ||
status | ||
"command exited with {}\n`{}`", |
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.
same comment as other PR... I liked the ordering of printouts in the old message more, actually! Feel free to keep the replace logic though.
status | ||
"command exited with {}\n`{}`", | ||
status, | ||
command_name.replace("\"", "") |
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.
Why does the command_name
have quotes? Do we need to add them?
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.
I'm not entirely sure why it has quotes, I think it has something to do with the implementation of Display
on Command
(although I'm not sure). After this the quotes are removed though - I don't think we are the ones that implemented the quotes in the first place.
Instead of printing out this error:
print out this error that lets people copy and paste the command we tried to run easier (before it had a bunch of quotes in it):