Skip to content
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

Align the gpc_error types more with the code #79

Merged
merged 1 commit into from
May 19, 2022

Conversation

tomas-abrahamsson
Copy link
Contributor

I added a type, grpc_callback_error() to specify what error values that the server side can handle from rpc method callback functions, since this is slightly different from the errors that can be returned on the client side: only grpc_error and grpc_extended_error are handled, neither error nor http_error, see for instance here.

If this is good—naming and all—then I can make a corresponding PR to the grpcbox_plugin template later.

@codecov
Copy link

codecov bot commented May 12, 2022

Codecov Report

Merging #79 (8f3448c) into main (1fbde82) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #79   +/-   ##
=======================================
  Coverage   38.99%   38.99%           
=======================================
  Files          28       28           
  Lines        2090     2090           
=======================================
  Hits          815      815           
  Misses       1275     1275           
Impacted Files Coverage Δ
src/grpcbox_stream.erl 64.24% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fbde82...8f3448c. Read the comment docs.

-type grpc_status() :: 0..16.
-type http_status() :: integer().
-type grpc_error() :: {grpc_status(), grpc_status_message()}.
-type grpc_error() :: {binary(), % containing a grpc_status() value as text
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-type grpc_error() :: {binary(), % containing a grpc_status() value as text
-type grpc_error() :: {unicode:unicode_binary(), % containing a grpc_status() value as text

Assuming this will always be a utf8 binary string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (yes, I suppose it will, although I admit I haven't read enough http2 spec to know)

Add a type to specify what error values that the server side
can handle from rpc method callback functions, since this
is slightly different from the errors that can be returned
on the client side.
@tsloughter tsloughter merged commit 848558a into tsloughter:main May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants