grpc-swift icon indicating copy to clipboard operation
grpc-swift copied to clipboard

Where's the documentation on error handling?

Open feelingsonice opened this issue 1 year ago • 1 comments

What are you trying to achieve?

Presumably, grpc-swift error codes follow the regular gRPC status code conventions. I'd like to catch and respond to different types of gRPC errors. For example, retry based on the retry instructions when its UNAVAILABLE, or do a token refresh when it's UNAUTHENTICATED.

What have you tried so far?

There's no documentation on this? I found GRPCError and the makeGRPCStatus() -> GRPCStatus method but GRPCError thing isn't an Error type.

feelingsonice avatar May 31 '24 07:05 feelingsonice

In general you should catch GRPCStatusTransformable and then use makeGRPCStatus() to give you the appropriate status code so that you make decisions about how to handle it.

glbrntt avatar May 31 '24 08:05 glbrntt