Skip to content

Commit

Permalink
Don't catch Lwt.Canceled exceptions in read
Browse files Browse the repository at this point in the history
  • Loading branch information
reynir committed Jan 17, 2025
1 parent 023b882 commit e0d8924
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ let read fd =
let b = Bytes.create l_int in
r b l_int >|= fun () ->
Bytes.unsafe_to_string b)
(fun e ->
(function
| Lwt.Canceled as e -> Lwt.reraise e
| e ->
Logs.err (fun m -> m "Error while reading: %s" (Printexc.to_string e));
Lwt.return (Error (`Msg "error in read")))

Expand Down

0 comments on commit e0d8924

Please sign in to comment.