Skip to content
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

[Question] improved errors in production project #798

Closed
solarhell opened this issue Nov 13, 2024 · 2 comments
Closed

[Question] improved errors in production project #798

solarhell opened this issue Nov 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@solarhell
Copy link

Is there anything like this in connect-rpc world?

Currently only grpc defined error can be returned in connectrpc.

image

Clients need to use string compare to match the underlying error.

@solarhell solarhell added the enhancement New feature or request label Nov 13, 2024
@timostamm
Copy link
Member

The Connect protocol is designed so that it can be transcoded to and from the gRPC protocol. This means that we are limited to the error codes also present in gRPC.

However, Connect (and most gRPC implementations) support error details. You can arbitrary Protobuf messages to provide error details. You can find documentation here, and they are also covered in the protocol spec.

@solarhell
Copy link
Author

solarhell commented Nov 18, 2024

Yeah, maybe I'll use proto to define errors and embed them as generic responses to zig-zag my way to custom errors, cause error matching for string comparison doesn't work well.

@jhump jhump closed this as completed Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants