Skip to content

Commit

Permalink
Merge pull request #58 from acerone85/acerone85@grpc-lwt-fix-status-r…
Browse files Browse the repository at this point in the history
…esponse-header

Grpc-lwt: fetch status code from response header
  • Loading branch information
tmcgilchrist authored May 17, 2024
2 parents e066812 + 695d451 commit 6fe6cfe
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 6fe6cfe

Please sign in to comment.