-
Notifications
You must be signed in to change notification settings - Fork 4
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
Right way to handle errors. #11
Comments
at the moment error handling in server side is not very detailed, you have to return proto response. if you really want to use ntex-grpc, you have to be prepared to dig in internals. i didnt work on server side api much, it is need more work in term of usability |
if you willing to spend time on server side api, i can help. personally, i wont be able to spend much time in near term |
@fafhrd91 thanks a lot. I can contribute and interested in it. Can you please help with defining your ideas or thoughts on it and I will try to implement them. |
quick idea is to use method call would be something like: async fn method(&self, req: proto::Request) -> impl Responder<proto::Response>; then it would be possible to define impl<T, E> Responder<Result<T, E>> for proto::Response
where
T: Into<proto::Response>
E: Into<proto::Response>
{
} also |
this is just an idea, feel free to design something more interesting |
I think it's a good idea. I will start working on it late March, early April. |
added simple response error handling Result<Method::Output, impl IntoMethod::Output> |
Hello, thanks a lot for this interesting project for gRPC support in Rust ecosystem.
I'm working on a replacing of tonic with ntex-grpc. One thing that I'm struggling with at the moment is error handling.
What is the ntex-grpc way to handle errors in server?
My idea was to use
Result
in method definition, but maybe idea in ntex-grpc is to write possible error structures in proto file and use oneof with success/fail structures for response types?The text was updated successfully, but these errors were encountered: