-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Return application level errors as a part of the gRPC response #462
Comments
Looks like we could use |
Related to #462 and also #477. Two reasons for this change: 1. We shouldn't be using `codes.Internal` as it's generated internally by gRPC so we won't be able to distinguish between gRPC protocol errors and application level errors, see https://github.com/grpc/grpc-go/blob/eeb9afa1f6b6388152955eeca8926e36ca94c768/codes/codes.go#L166. 2. We don't really do anything with the code at the moment, it's only printed in a confusing way (see #477) ---
I understand the need for application level errors but I don't think it should have anything with grpc errors. depending on which errors we want to send we need to add it to the protobuf. grpc errors are mostly used when something bad happened on the server. |
Most errors returned from
The only ones that could be related to gRPC protocol are:
plugin-sdk/internal/servers/destinations.go Line 101 in 62692b9
|
There can be also grpc errror returned after this function is returned that we actually saw when buffer is too big so there is no good way to distinguish both over the grpc error field. |
Agree there could be both application errors and gRPC errors. Right now we're mixing both so the purpose of this issue is to discuss a solution so we can distinguish between them. One approach is in #487, to use the |
Closing as won't fix as we've improved error reporting |
TLDR: We should consider having application level errors as a part of the gRPC responses, to make it easier to identify them.
For example in the following line:
plugin-sdk/clients/destination.go
Line 303 in ab7ca97
failed to CloseAndRecv
is not necessarily correct, aserr
is whatever is returned from the following function:plugin-sdk/internal/servers/destinations.go
Line 65 in ab7ca97
Not sure what's the best solution (need to do some research), but we could add an error(s) field to gRPC responses so we have a clear separation between application level errors and gRPC/communication level ones.
Also due to grpc/grpc-go#2934 we can't unwrap errors.
The text was updated successfully, but these errors were encountered: