oxidecomputer / oxide.rs

The Oxide Rust SDK and CLI
Mozilla Public License 2.0
37 stars 12 forks source link

CLI: print error source #740

Closed wfchandler closed 1 month ago

wfchandler commented 1 month ago

Currently the oxide binary will print the error returned when a subcommand fails, but not any source errors attached to it. In the context of connection failures from the auth login subcommand, the output was only Request failed, giving the user no context on why the failure occurred.

If present, append the source of the error to the user-facing message.

Previously:

$ oxide auth login --host oxide.invalid
Request failed

Now:

$ oxide auth login --host oxide.invalid
Request failed: error sending request for url (http://oxide.invalid/device/auth): error trying to connect: dns error: failed to lookup address information: nodename nor servname  provided, or not known
wfchandler commented 1 month ago

Ready for another look @ahl, the other changes you had comments on were all removed by https://github.com/oxidecomputer/oxide.rs/pull/727.