Add context to functions called from build_ukify#1980
Add context to functions called from build_ukify#1980jeckersb wants to merge 1 commit intobootc-dev:mainfrom
build_ukify#1980Conversation
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
|
Draft for now but we'll use this to collect extra context used to track down what's going on in #1977 |
There was a problem hiding this comment.
Code Review
This pull request is a good step towards improving error handling by adding context to several functions using fn_error_context. This will make debugging failures much easier.
I've added one suggestion to make one of the context messages more descriptive.
To build on this, you might also consider extending this pattern to other fallible functions in the call stacks of the modified functions. For example, new_temp_composefs_repo in crates/lib/src/bootc_composefs/digest.rs and find_uki_path in crates/lib/src/kernel.rs could also benefit from a #[context(...)] attribute to provide even more granular error reporting.
Overall, this is a valuable change for maintainability.
|
|
||
| /// Load and parse all bootc kargs.d files in the specified root, returning | ||
| /// a combined list. | ||
| #[context("Getting kargs in root")] |
There was a problem hiding this comment.
The context message "Getting kargs in root" is a bit generic. A more descriptive message that details what the function is doing would be more helpful in an error chain. Based on the function's documentation ("Load and parse all bootc kargs.d files in the specified root"), a more specific context would improve debuggability.
| #[context("Getting kargs in root")] | |
| #[context("Loading and parsing kargs.d files from root")] |
There was a problem hiding this comment.
Yes but these should be pretty terse since they get strung together into the final error message which can be pretty long by the end of it.
Signed-off-by: John Eckersberg jeckersb@redhat.com