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

Where's the documentation on error handling? #1900

Open
feelingsonice opened this issue May 31, 2024 · 1 comment
Open

Where's the documentation on error handling? #1900

feelingsonice opened this issue May 31, 2024 · 1 comment
Labels

Comments

@feelingsonice
Copy link

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.

@glbrntt
Copy link
Collaborator

glbrntt commented May 31, 2024

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.

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

No branches or pull requests

2 participants