Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpm: Overhaul errors #711

Merged
merged 2 commits into from
Jan 23, 2024
Merged

tpm: Overhaul errors #711

merged 2 commits into from
Jan 23, 2024

Conversation

ansasaki
Copy link
Contributor

@ansasaki ansasaki commented Jan 22, 2024

Add granular error types for every possible error raised by the tpm module. This improves diagnosing the cause of the errors without showing complex errors coming from underlying libraries.

This also drops all expect() and unwrap() uses to avoid panicking.

Fixes: #330, #639

Make get_idevid_template() to return TpmError

Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
Add granular error types for every possible error raised by the tpm
module. This improves diagnosing the cause of the errors without showing
complex errors coming from underlying libraries.

This also drops all 'expect()` and `unwrap()` uses to avoid panicking.

Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 180 lines in your changes are missing coverage. Please review.

Comparison is base (c649ae0) 0.00% compared to head (e0ba2f8) 65.23%.

Additional details and impacted files
Flag Coverage Δ
e2e-testsuite 59.06% <45.51%> (?)
upstream-unit-tests 52.07% <18.80%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
keylime/src/tpm.rs 68.61% <47.82%> (ø)

... and 21 files with indirect coverage changes

Copy link
Contributor

@aplanas aplanas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting use of map_err with an enum.

@ansasaki ansasaki merged commit c9365e8 into keylime:master Jan 23, 2024
10 checks passed
@ansasaki ansasaki deleted the overhaul_errors branch January 23, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better error handling on agent startup
5 participants