-
Hi! I am migrating our project from grpc-web to connect-es. I ran into a problem that we have custom statuses, for example 999. I understand that this is a terrible decision, but it is not going to change anytime soon. Since this is a custom status, it is converted to "[internal] invalid grpc-status: 999" Is there a way around this? Maybe there is a solution to get custom statuses? Connect for Web |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think the best option is to provide a custom In this function, it should be easy enough to act on the custom HTTP status, and throw your own ConnectError. You can put the custom HTTP status into error metadata or error details (see the documentation here), so that you can retrieve it in a catch block. |
Beta Was this translation helpful? Give feedback.
I think the best option is to provide a custom
fetch
function to the gRPC-Web transport. See the documentation here.In this function, it should be easy enough to act on the custom HTTP status, and throw your own ConnectError. You can put the custom HTTP status into error metadata or error details (see the documentation here), so that you can retrieve it in a catch block.