Support multi-error wrapping in go #316
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#316
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After go1.20 we can wrap multiple errors https://go.dev/doc/go1.20#errors
I don't like the idea but let's discuss whether we need it.
As an example where this could be useful:
TBH I would add some linter which prohibits its usage completely.
but why?
I think it is easy to add lot's of unnecessary context this way without thinking at all, which makes is harder to handle errors.
And all the cases I was thinking about (e.g. put object fails on each shard, combine errors) (1) require more context than simple "wrap" can provide and (2) have a dynamic number of errors to combine.
Do you have any particular usecase we can apply for node right now?
I don't have a particular use case from the top of my head. I was just wondering what was the argument to have a linter prohibit it; that seems to go a bit overboard.
While I'm not buying the multiwrap thing yet, I'm willing to entertain ideas employing it. Error handling in node is quite messy, and also there's the fact that if some of our dependencies start to employ it as part of their public API, the interaction might be weird if we have a linter getting in the middle.