expose Bad_req in Server

This commit is contained in:
Simon Cruanes 2024-04-16 14:45:21 -04:00
parent e5191f0fd7
commit bc34363f60
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 5 additions and 0 deletions

View file

@ -2,6 +2,8 @@ open Common_
type resp_error = Response_code.t * string type resp_error = Response_code.t * string
exception Bad_req = Common_.Bad_req
module Middleware = struct module Middleware = struct
type handler = IO.Input.t Request.t -> resp:(Response.t -> unit) -> unit type handler = IO.Input.t Request.t -> resp:(Response.t -> unit) -> unit
type t = handler -> handler type t = handler -> handler

View file

@ -8,6 +8,9 @@
@since 0.13 @since 0.13
*) *)
exception Bad_req of int * string
(** Exception raised to exit request handlers with a code+error message *)
(** {2 Middlewares} (** {2 Middlewares}
A middleware can be inserted in a handler to modify or observe A middleware can be inserted in a handler to modify or observe