Skip to content

Commit

Permalink
Add error status logging for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruhlmann committed Mar 19, 2024
1 parent 337f5bd commit c154868
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ let get_json url =
let* body = Cohttp_lwt.Body.to_string body in
let json = Yojson.Basic.from_string body in
Lwt.return @@ Some json
else Lwt.return None
else
(* Find out what to do with this later. What's the return type? Do we have Result<a,b>? *)
let* _ = Lwt_io.printl (Printf.sprintf "HTTP Error: %s" (Cohttp.Code.string_of_status status)) in
Lwt.return None
;;

let get ?requester endpoint client =
Expand Down

0 comments on commit c154868

Please sign in to comment.