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

features: remove EPERM wrapping exception, automatically wrap errors #749

Merged
merged 2 commits into from Jul 29, 2022

Commits on Jul 29, 2022

  1. features: wrap EPERM errors from all probe APIs

    In an attempt to simplify the switch blocks in all types of feature
    probes, lift the arbitrary EPERM wrapping exception.
    
    Also, move the call to fd.Close() out of the switch statement to live
    closer to the call that returns the fd. The fd can always be immediately
    closed.
    
    Signed-off-by: Timo Beckers <timo@isovalent.com>
    ti-mo committed Jul 29, 2022
    Copy the full SHA
    bd9668e View commit details
    Browse the repository at this point in the history
  2. features: automatically wrap all feature probe errors

    Instead of relying on repeated calls to fmt.Errorf("...: %w", err) to ensure
    we never return naked sentinels, add error wrappers at a few key locations.
    
    This abstracts and centralizes the wrapping logic to make the probe logic
    itself a bit leaner.
    
    Signed-off-by: Timo Beckers <timo@isovalent.com>
    ti-mo committed Jul 29, 2022
    Copy the full SHA
    5c51a91 View commit details
    Browse the repository at this point in the history