Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cohttp-eio: Improve error handling in example server #1023

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

talex5
Copy link
Contributor

@talex5 talex5 commented Feb 27, 2024

The example was using ~on_error:raise, which causes the server to crash if any error occurs handling a connection. This is unlikely to be what you want. Instead, log the error and continue.

This also now matches the behaviour of the Lwt example, which just logs errors and continues.

(from #1021 (comment))

@talex5 talex5 force-pushed the eio-fix-example branch 2 times, most recently from 034aba8 to 5c9b4dd Compare February 27, 2024 14:24
The example was using `~on_error:raise`, which causes the server to
crash if any error occurs handling a connection. This is unlikely to be
what you want. Instead, log the error and continue.

This also now matches the behaviour of the Lwt example, which just logs
errors and continues.
@mseri mseri merged commit cf2ae33 into mirage:master Feb 27, 2024
16 of 19 checks passed
@mseri
Copy link
Collaborator

mseri commented Feb 27, 2024

Thanks

avsm added a commit to avsm/opam-repository that referenced this pull request Nov 21, 2024
CHANGES:

- bump minimum dune version to 3.8 (@avsm)
- cohttp-eio: Use system authenticator in example.
- http, cohttp: remove the scheme field from requests. This means that
  [Request.uri] no longer returns the same URI as was to create the request
  with [Request.make] (@rgrinberg 1086)
- cohttp-eio: Remove unused `Client_intf` module (talex5 mirage/ocaml-cohttp#1081)
- cohttp-eio: Make server response type abstract and allow streaming in cohttp-eio (talex5 mirage/ocaml-cohttp#1024)
- cohttp-{lwt,eio}: server: add connection header to response if not present (ushitora-anqou mirage/ocaml-cohttp#1025)
- cohttp-curl: Curl no longer prepends the first HTTP request header to the output. (jonahbeckford mirage/ocaml-cohttp#1030, mirage/ocaml-cohttp#987)
- cohttp-eio: client: use permissive argument type for make_generic
- cohttp-eio: Improve error handling in example server (talex5 mirage/ocaml-cohttp#1023)
- cohttp-eio: Don't blow up `Server.callback` on client disconnections. (mefyl mirage/ocaml-cohttp#1015)
- http: Fix assertion in `Source.to_string_trim` when `pos <> 0` (mefyl mirage/ocaml-cohttp#1017)
- cohttp: `Cohttp.Request.make_for_client` no longer allows setting both
  `~chunked:true` and `~body_length`.
- cohttp-lwt-unix: Don't blow up when certificates are not available and no-network requests are made. (akuhlens mirage/ocaml-cohttp#1027)
  + Makes `cohttp-lwt.S.default_ctx` lazy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants