diff --git a/CHANGES.md b/CHANGES.md index 0beaf4d54..8aaa01936 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ ## Unreleased +- cohttp-eio: Improve error handling in example server (talex5 #1023) - cohttp-eio: Don't blow up `Server.callback` on client disconnections. (mefyl #1015) - http: Fix assertion in `Source.to_string_trim` when `pos <> 0` (mefyl #1017) diff --git a/cohttp-eio/examples/server1.ml b/cohttp-eio/examples/server1.ml index 4393d6071..7f47c4b9a 100644 --- a/cohttp-eio/examples/server1.ml +++ b/cohttp-eio/examples/server1.ml @@ -53,4 +53,5 @@ let () = Eio.Net.listen env#net ~sw ~backlog:128 ~reuse_addr:true (`Tcp (Eio.Net.Ipaddr.V4.loopback, !port)) and server = Cohttp_eio.Server.make ~callback:handler () in - Cohttp_eio.Server.run socket server ~on_error:raise + Cohttp_eio.Server.run socket server + ~on_error:(fun ex -> Logs.warn (fun f -> f "%a" Eio.Exn.pp ex))