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

Grpc-lwt: fetch status code from response header #58

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/grpc-lwt/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ let call ~service ~rpc ?(scheme = "https") ~handler ~(do_request : do_request)
match response.status with
| `OK ->
let+ status =
match H2.Headers.get headers "grpc-status" with
| Some _ -> Lwt.return (Grpc.Status.extract_status headers)
match H2.Headers.get response.headers "grpc-status" with
| Some _ -> Lwt.return (Grpc.Status.extract_status response.headers)
| None -> status
in
Ok (handler_res, status)
Expand Down
Loading