-
-
Notifications
You must be signed in to change notification settings - Fork 124
/
error_handler.mli
67 lines (45 loc) · 1.63 KB
/
error_handler.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(* This file is part of Dream, released under the MIT license. See LICENSE.md
for details, or visit https://github.com/aantron/dream.
Copyright 2021 Anton Bachin *)
module Dream = Dream_pure
(* User's error handlers and defaults. These actually generate error response
templates and/or do logging. *)
val default : Dream.error_handler
val debug_error_handler : Dream.error_handler
val customize :
(Dream.error -> string -> Dream.response -> Dream.response Lwt.t) ->
Dream.error_handler
(* Internal functions called by the framework to report errors. These translate
various libraries' errors into Error.error and call the user's error
handler. The signatures are arranged so that these helpers can be partially
applied and then passed in as arguments where the libraries want error
handler arguments. *)
(* val app :
Dream.app ->
Error.error_handler ->
Dream.middleware *)
val app :
Dream.error_handler ->
(Dream.error -> Dream.response Lwt.t)
val httpaf :
Dream.app ->
Dream.error_handler ->
(Unix.sockaddr -> Httpaf.Server_connection.error_handler)
val h2 :
Dream.app ->
Dream.error_handler ->
(Unix.sockaddr -> H2.Server_connection.error_handler)
val tls :
Dream.app ->
Dream.error_handler ->
(Unix.sockaddr -> exn -> unit)
val websocket :
Dream.error_handler ->
Dream.request ->
Dream.response ->
(Websocketaf.Wsd.t -> [ `Exn of exn ] -> unit)
val websocket_handshake :
Dream.error_handler ->
(Dream.request -> Dream.response -> string -> Dream.response Lwt.t)
(* Logger also used by elsewhere in the HTTP integration. *)
val log : Dream__middleware.Log.sub_log