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.Canceled and context.DeadlineExceeded should 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:
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 canceled
error is returned from this method: https://github.com/nspcc-dev/neofs-sdk-go/blob/3d4a462485d427f15c26a1f8a31873dcc9500cd6/client/object_search.go#L140This 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.Canceled
andcontext.DeadlineExceeded
should 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: