You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing custom exception handling with gRPC status codes in which I send specific status codes for specific exceptions such as INVALID_ARGUMENT or FAILED_PRECONDITION instead of general UNKNOWN status.
I managed to send the status codes I want by using await stream.send_trailing_metadata().
However, when I try to create a similar scenario in unit tests, I don't see that specific status code but STATUS_UNKNOWN error appears.
Is there a correct way to extract the status code from the metadata itself? This is what I am doing in my test:
servicer = MyServicer()
async with ChannelFor([servicer]) as channel:
stub = MyStub(channel)
request = MyRequest()
response = await stub.MyService([request])
Thanks for the help!
The text was updated successfully, but these errors were encountered:
Hello,
I am implementing custom exception handling with gRPC status codes in which I send specific status codes for specific exceptions such as
INVALID_ARGUMENT
orFAILED_PRECONDITION
instead of generalUNKNOWN
status.I managed to send the status codes I want by using
await stream.send_trailing_metadata()
.However, when I try to create a similar scenario in unit tests, I don't see that specific status code but
STATUS_UNKNOWN
error appears.Is there a correct way to extract the status code from the metadata itself? This is what I am doing in my test:
Thanks for the help!
The text was updated successfully, but these errors were encountered: