Skip to content

Commit

Permalink
Server.create: add ?on_exn
Browse files Browse the repository at this point in the history
  • Loading branch information
vbmithr committed Dec 18, 2016
1 parent ee396e4 commit 09c2d14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lwt/cohttp_lwt_unix.ml
Expand Up @@ -83,8 +83,8 @@ module Server = struct
respond_not_found ()
| exn -> Lwt.fail exn)

let create ?timeout ?stop ?(ctx=Cohttp_lwt_unix_net.default_ctx)
let create ?timeout ?stop ?on_exn ?(ctx=Cohttp_lwt_unix_net.default_ctx)
?(mode=`TCP (`Port 8080)) spec =
Conduit_lwt_unix.serve ?timeout ?stop ~ctx:ctx.Cohttp_lwt_unix_net.ctx
Conduit_lwt_unix.serve ?timeout ?stop ?on_exn ~ctx:ctx.Cohttp_lwt_unix_net.ctx
~mode (callback spec)
end
1 change: 1 addition & 0 deletions lwt/cohttp_lwt_unix.mli
Expand Up @@ -68,6 +68,7 @@ module Server : sig
val create :
?timeout:int ->
?stop:unit Lwt.t ->
?on_exn:(exn -> unit) ->
?ctx:Cohttp_lwt_unix_net.ctx ->
?mode:Conduit_lwt_unix.server -> t -> unit Lwt.t
end

0 comments on commit 09c2d14

Please sign in to comment.