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

Handling gRPC exceptions by gRPC Labview #363

Open
Franky-86 opened this issue Jun 19, 2024 · 1 comment
Open

Handling gRPC exceptions by gRPC Labview #363

Franky-86 opened this issue Jun 19, 2024 · 1 comment

Comments

@Franky-86
Copy link

Franky-86 commented Jun 19, 2024

Since gRPC-exceptions are the recommended way of handling errors in gRPC, I'd like to use that rather than adding a status field to every response message.

Generated exceptions from server (e.g. C# implementation) can be handled by Labview client. But what about the other way around? How to send exceptions from Labview Server to clients.

AB#2778642

@jasonmreding
Copy link
Collaborator

It is up to each gRPC language plugin to handle errors in a style that makes the most sense for that language. An error in this case is an RPC where the response status code is anything other than OK. For a LabVIEW client, that means the status code and details string from the response will get converted to an error cluster. For a C# client, that means a RpcException will get thrown. If you are adding your own error fields to the messages defined in the .proto file, then you are effectively bypassing the built in error reporting of gRPC.

If this is what you are doing, then in general I would say don't do that. If you are doing that because you find the built in error reporting somewhat limited, that's a valid criticism. In fact that's what has led to a "richer error model" that has been adopted as an ad hoc convention by many languages. However, grpc-labview doesn't currently provide any libraries/APIs that makes adopting a rich error model easy. See here for more information about these concepts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants