I don't know if I'm reading this wrong, but it doesn't look to me like the generated callbacks in the behaviour modules have the correct type specifications. For example, for a unary call the behaviour says:
-callback unary(ctx:ctx(), my_pb:my_input()) ->
{ok, my_pb:my_output(), ctx:ctx()} | grpcbox_stream:grpc_error_response().
where grpc_error_response is defined as:
-type grpc_error_response() :: {error, grpc_error(), #{headers => map(),
trailers => #{}}} |
{http_error, {http_status(), unicode:chardata()}, #{headers => map(),
trailers => #{}}} |
{error, term()}.
but the code in grpxbox_stream:handle_unary is doing:
case [make the call] of
{ok, Response, Ctx2} ->
State1 = from_ctx(Ctx2),
send(falsoe, Response, State1);
E={grpc_error, _} ->
throw(E);
E={grpc_extended_error, _} ->
throw(E)
end.
when doesn't match a grpc_error_response. I'm using master for both grpcbox_plugin and grpcbox - should these two line up? If so, then I'm happy to do a PR to make the behaviours match the code
I don't know if I'm reading this wrong, but it doesn't look to me like the generated callbacks in the behaviour modules have the correct type specifications. For example, for a unary call the behaviour says:
where
grpc_error_responseis defined as:but the code in grpxbox_stream:handle_unary is doing:
when doesn't match a grpc_error_response. I'm using master for both grpcbox_plugin and grpcbox - should these two line up? If so, then I'm happy to do a PR to make the behaviours match the code