Giter VIP home page Giter VIP logo

Comments (2)

polvalente avatar polvalente commented on June 9, 2024 1

Yeah, it's something along those lines!

I don't worry too much about retrocompatibility in the sense that this is a new code path that didn't exist before, but we should ensure the test coverage is good for the modified code path.

I'm happy to review a PR on this

from grpc.

avillen avatar avillen commented on June 9, 2024

Do you have something in mind about this? taking a look at the code I think that it may be "as easy" as the following on this part:

     result = server.__call_rpc__(path, stream)

     case result do
+      {:ok, _stream, error = %GRPC.RPCError{message: nil, status: status}} ->
+        {:error, %{error | message: GRPC.Status.status_message(status)}}
+
+      {:ok, _stream, error = %GRPC.RPCError{}} ->
+        {:error, error}
+
       {:ok, stream, response} ->
         stream
         |> GRPC.Server.send_reply(response)

The first match is because, if I understand correctly, right now the server creates a GRPC.RPCError exception that already generates the :message if necessary, so we need to generate it somehow.

I think that this will be retrocompatible, so both exception and "handled" errors will be allowed. WDYT? I can submit a quick PR if you agree 😄 or if you have something different in mind or I'm wrong, please, ignore me 😂

from grpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.