Do not ignore errors ever #1205

Open
opened 2025-12-28 17:22:10 +00:00 by sami · 2 comments
Owner

Originally created by @carpawell on GitHub (Apr 2, 2024).

Expected Behavior

Never ignore errors in gonang.

Current Behavior

Code may ignore some errors (even if they are not expected at all, that is not good).

Possible Solution

Panic if an error is not expected at all.

Context

At least CLIs are affected: binding flags, getting flags, marking flags.
Some other places may be affected too.

Originally created by @carpawell on GitHub (Apr 2, 2024). <!-- Provide a general summary of the issue in the Title above --> ## Expected Behavior Never ignore errors in gonang. ## Current Behavior Code may ignore some errors (even if they are not expected at all, that is not good). ## Possible Solution Panic if an error is not expected at all. ## Context At least CLIs are affected: [binding flags](https://github.com/nspcc-dev/neofs-node/blob/97a2dc7414ca80092fcf4b55dd2d347d7d4d00d5/cmd/neofs-cli/modules/root.go#L70), [getting flags](https://github.com/nspcc-dev/neofs-node/blob/97a2dc7414ca80092fcf4b55dd2d347d7d4d00d5/cmd/neofs-lens/root.go#L24), [marking flags](https://github.com/nspcc-dev/neofs-node/blob/97a2dc7414ca80092fcf4b55dd2d347d7d4d00d5/cmd/neofs-lens/internal/flags.go#L27-L28). Some other places may be affected too.
Author
Owner

@roman-khimov commented on GitHub (Apr 2, 2024):

Narrow down the scope, please. This is too broad.

@roman-khimov commented on GitHub (Apr 2, 2024): Narrow down the scope, please. This is too broad.
Author
Owner

@carpawell commented on GitHub (Apr 2, 2024):

Narrow down the scope, please.

Finding all the places == 90% of solving the issue. We do ignore errors sometimes (Context has 3 examples with cobra lib errs ignorance). What exact do you mean?

@carpawell commented on GitHub (Apr 2, 2024): > Narrow down the scope, please. Finding all the places == 90% of solving the issue. We do ignore errors sometimes (`Context` has 3 examples with `cobra` lib errs ignorance). What exact do you mean?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-node#1205
No description provided.