Skip to content

Handle UEFI warnings more cleanly #60

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

Merged
merged 13 commits into from
Oct 13, 2018
Merged

Handle UEFI warnings more cleanly #60

merged 13 commits into from
Oct 13, 2018

Conversation

HadrienG2
Copy link
Contributor

@HadrienG2 HadrienG2 commented Oct 12, 2018

UEFI has warnings, which represent non-fatal errors. Currently, we treat them as fatal errors, which is somewhat pessimistic. This PR explores a different strategy which allows the user to do various things with warnings including pattern-matching them, logging them silently, or handling them as errors.

Some errors which were previously discarded, such as EFI_TIMEOUT in serial communication, are now reported as warnings.

Fixes #52.

Copy link
Collaborator

@GabrielMajeri GabrielMajeri left a comment

Choose a reason for hiding this comment

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

There are some things which could be debated but I can't see a more ergonomic solution for now.

The whole design of UEFI's "extensible" warning / error codes pretty much breaks the point of listing the possible error values in the first place 😞 I don't think there's any other way of making error handling convenient and safe in this case.

@HadrienG2
Copy link
Contributor Author

HadrienG2 commented Oct 13, 2018

The latest commit is an experiment towards improving the ergonomics of the Result type without losing generality.

@HadrienG2 HadrienG2 changed the title [WIP] Handle UEFI warnings more cleanly Handle UEFI warnings more cleanly Oct 13, 2018
@HadrienG2
Copy link
Contributor Author

Alright, the version with the ResultExt extension trait starts to feel like something I could get behind. Feel like taking a second look?

@HadrienG2 HadrienG2 merged commit 0037af7 into master Oct 13, 2018
@HadrienG2 HadrienG2 deleted the warnings branch October 13, 2018 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants