generated from rust-vmm/crate-template
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tree-wide: actually pretty-print error messages
We setup pretty-printing with all the thiserror-based Error structs, but then only bubble the error up to the main, where it just gets printed with the `Debug` trait. This "catches" the error in the main and performs pretty printing using the `Display` trait. Before: Error: FailedCreatingListener(SocketError(Os { code: 98, kind: AddrInUse, message: "Address already in use" })) After: [2023-07-06T17:20:47Z ERROR vhost_device_scsi] Failed creating listener: socket error: Address already in use (os error 98) vhost-device-vsock is a bit special since it does not let error messages bubble up to the main. It also does .unwrap() in most places, but it _does_ pretty print errors during the main request handling part. Signed-off-by: Erik Schilling <[email protected]>
- Loading branch information
Showing
5 changed files
with
34 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters