-
Notifications
You must be signed in to change notification settings - Fork 52
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
Handling errors #15
Comments
gRPC error returned from |
@remko You could just check the error object instead. |
@lyonlai No,
|
@atreya2011 There's no unambiguous way to check for an error object at that level. I would have to check for the presence of Moreover, I would need to manually do this check for every call, or at least manually wrap every call, which is tedious. |
hmm. I see, that make sense. @remko do you have something already and you wanted to contribute? |
@lyonlai I don't, but I should be able to easily do, just wanted to check up front. I will do the changes and verify it with my use case, and send a PR. |
awesome, expecting it. |
The fetch function seems to ignore the .ok status of the fetch response. This means that if there is a gRPC error, data is returned of the error type instead of the declared response type.
Shouldn’t the fetch function throw in case of http errors (I.e. if .ok is false), so the client can catch errors? (And so there is no typing inconsistency)
The text was updated successfully, but these errors were encountered: