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
Hey thanks for your great work, I was confused about how to do error handling.
Why doesn't ServerError implement some common HTTP errors like tonic does, currently if you return Result<T, CustomErrorType> in the service definition, the client will return Result<Result<T, CustomErroryType>, RpcError>, which is very counter-intuitive, especially when using tokio::try_join.
For example:
let(a, b) = tokio::try_join(
service_a.get(),
service_b.get(),)?;let a = a?;let b = b?;
Like in the code above, you need to handle errors twice,isn't this a bit counter-intuitive? Am I missing something?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey thanks for your great work, I was confused about how to do error handling.
Why doesn't ServerError implement some common HTTP errors like tonic does, currently if you return Result<T, CustomErrorType> in the service definition, the client will return Result<Result<T, CustomErroryType>, RpcError>, which is very counter-intuitive, especially when using tokio::try_join.
For example:
Like in the code above, you need to handle errors twice,isn't this a bit counter-intuitive? Am I missing something?
Best wishes for you,have a niiiiice day~~~
Beta Was this translation helpful? Give feedback.
All reactions