0

We have an application where we have a need to return Custom GRPC Status codes, as we feel the codes are limited. Is there a way we can return Custom GRPC Status code?

I tried to return custom status code but io.grpc.Status will convert any non-recognized status code to UNKNOW ex:2 UNKNOWN: Unknown code 80

StatusRunTimeException contains Status which accepts only predefined enum values. Has anyone has experience in returning custom status in GRPC?

Found this link - https://github.com/grpc/grpc-java/issues/515 related to custom status codes.

1 Answer 1

1

No, custom status codes are not allowed. You list three different ways it was not allowed. It isn't supported.

Issue 515 also says:

For custom status information, use Metadata.

So you can use Metadata instead of a custom status code. The variations of that approach are in Pattern for rich error handling in gRPC .

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.