Remove anyhow from the library API & simplify load_root_cert#79
Conversation
|
this seems relevant: oxidecomputer/omicron#8558 |
| @@ -50,10 +48,6 @@ pub enum Error { | |||
| #[error("io error: {0}")] | |||
| Io(#[from] std::io::Error), | |||
There was a problem hiding this comment.
As you surmised, John's doc is helpful here. There is no need to lose this context, it just gets a tad more tedious in usage. We should add specific errors for opening and reading files as described in https://github.com/oxidecomputer/omicron/blob/john/error-docs/docs/error-types-and-logging.adoc#2-defining-error-enums-with-thiserror.
We'd then change the #[from] to #[source] for the underlying error and add a path field that we could report in the Display impl with the same messages as we did previously in with_context.
There was a problem hiding this comment.
https://github.com/oxidecomputer/omicron/blob/main/docs/error-types-and-logging.adoc this is now merged if like me you went to click on the link and it now 404's
|
Lost track of this one. I've updated it w/ recommendations from john's doc. Apologies for the delay. Now all I've gotta do is go back and fix all the rust I've ever written :) |
We lose a lot of context (including the file path) w/ this approach but I'm not sure I've got a better alternative