This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 164
Unwrapping errors before converting to gRPC status #83
Comments
I think using the stdlib wrapping/unwrapping introduced in go1.13 is the right thing to do, however, I think the best thing to do is provide a split by using build tags for some time. |
Ok, but that does not work with the So better to not support this and migrate everywhere to the 1.13 error wrapping? |
Sorry should have been more clear:
|
Ok, that sound good 👍 I wasn't aware of build tags, need to take a look at it. |
Agree with @brancz 👍 with build tag solution. |
I already updated the draft to PR using build tags, PTAL #84 |
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I discovered that when using error wrapping, the reported
grpc_status
is reported as anUnknown
status. I encountered this issue in the Thanos project where for examplecontext canceled
error is normally reported asCancelled
gRPC status but once wrapped becomesUnknown
.The issue should be eventually solved in the go-grpc status package. There is even an issue for this grpc/grpc-go#2934. The problem is there are currently cca 3 ways to wrap errors and every one doing it different way.
I created a draft with bit hacky unwrapping of two of those, native Go unwrapping (commented out since added in 1.13.0 and I'm not sure how to deal with the dependency) and
pkg/errors
wrapf
.Not sure what is the right way to handle this, but currently this is quite inconvenient.
I'd be glad for any opinions on this.
Thanks!
The text was updated successfully, but these errors were encountered: