Skip to content

netboot: fix swallowed errors in ConfigureInterface - #586

Open
michaelpesa wants to merge 1 commit into
insomniacslk:masterfrom
michaelpesa:fix-config-intf-err
Open

netboot: fix swallowed errors in ConfigureInterface#586
michaelpesa wants to merge 1 commit into
insomniacslk:masterfrom
michaelpesa:fix-config-intf-err

Conversation

@michaelpesa

Copy link
Copy Markdown

The deferred rt.Close() handler checked the wrong variable (err, the named return, instead of cerr). Any error returned from the function body was overwritten by the (almost always nil) rt.Close() result. Override the named return error only when it is nil.

The deferred rt.Close() handler checked the wrong variable (err, the
named return, instead of cerr). Any error returned from the function
body was overwritten by the (almost always nil) rt.Close() result.
Override the named return error only when it is nil.

Signed-off-by: Michael Pesa <michael.pesa@icloud.com>
@pmazzini

pmazzini commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Is this something we can unit test?

@pmazzini pmazzini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

tests not passing

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.

2 participants