softprops / shiplift

🐳 🦀 rust interface for maneuvering docker containers
MIT License
618 stars 119 forks source link

Display error message for `Error::Fault` #292

Closed cswinter closed 3 years ago

cswinter commented 3 years ago

What did you implement:

Small change to the Display implementation of Error that includes the message returned by docker. IMO this should be part of the display string since it makes errors much more informative. E.g., instead of Docker Error: 404 Not Found an error would now be displayed as Docker Error: 404 Not Found: No such container: containername

Closes: https://github.com/softprops/shiplift/issues/288

How did you verify your change:

manually tested it on one API request 😄

What (if anything) would need to be called out in the CHANGELOG for the next release:

include additional information in error messages

cswinter commented 3 years ago

Arguably errors would actually be slightly better by displaying just the message and not the error code, which might not be of interest to users and doesn't convey much additional information. But not sure if docker consistently returns good error messages, maybe sometimes it's good to have the status code as well.

cswinter commented 3 years ago

Another option would be to display just the message, except when it's an empty string in which case it shows the error code.