Fix client and try%lwt

This commit is contained in:
Shon Feder 2025-05-25 19:12:55 -04:00
parent d096b9de46
commit 099a05498c
No known key found for this signature in database

View file

@ -86,8 +86,7 @@ module Httpc : sig
val cleanup : t -> unit val cleanup : t -> unit
end = struct end = struct
open Opentelemetry.Proto open Opentelemetry.Proto
open Lwt.Syntax module Httpc = Cohttp_eio.Client
module Httpc = Cohttp_lwt_unix.Client
type t = unit type t = unit
@ -106,9 +105,9 @@ end = struct
Header.(add headers "Content-Type" "application/x-protobuf") Header.(add headers "Content-Type" "application/x-protobuf")
in in
let body = Cohttp_lwt.Body.of_string bod in let body = Cohttp_eio.Body.of_string bod in
let r = let r =
try%lwt try
let r = Httpc.post ~headers ~body uri in let r = Httpc.post ~headers ~body uri in
Ok r Ok r
with e -> Error e with e -> Error e