mirror of
https://github.com/nspcc-dev/neofs-sdk-go.git
synced 2026-03-01 04:29:18 +00:00
Properly wrap context-related NeoFS Client errors #234
Labels
No labels
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U2
U2
U3
U4
blocked
bug
client
config
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
performance
pool
question
security
task
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-sdk-go#234
Loading…
Add table
Add a link
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?
Originally created by @AnnaShaleva on GitHub (Sep 10, 2024).
Is your feature request related to a problem? Please describe.
I'm using NeoFS Client to perform object get and object search requests with cancellation context. If context is cancelled by the caller's code, the
rpc error: code = Canceled desc = context cancelederror is returned from this method:nspcc-dev/neofs-sdk-go@3d4a462485/client/object_search.go (L140)This error is expected since context was explicitly cancelled. However, I can't identify this error with
if errors.Is(err, context.Canceled)because it's not a wrapped error.Describe the solution you'd like
context.Canceledandcontext.DeadlineExceededshould be recognizable by NeoFS client and should be returned as wrapped errors from all clients methods that work with context. We're at Go 1.22, multierror wrapping is supported.Describe alternatives you've considered
Leave it as is, but it leads to the following code on the caller's side:
@roman-khimov commented on GitHub (Sep 10, 2024):
But if it happens server-side it can be a problem.