package dream

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file error.ml

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
(* 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 =
struct
  include Dream__pure.Inmost
  module Log = Log
end



type error = {
  condition : [
    | `Response of Dream.response
    | `String of string
    | `Exn of exn
  ];
  layer : [
    | `TLS
    | `HTTP
    | `HTTP2
    | `WebSocket
    | `App
  ];
  (* TODO Any point in distinguishing HTTP and HTTP2 errors? *)
  caused_by : [
    | `Server
    | `Client
  ];
  request : Dream.request option;
  response : Dream.response option;
  client : string option;
  severity : Dream.Log.log_level;
  debug : bool;
  will_send_response : bool;
}

type error_handler = error -> Dream.response option Lwt.t
OCaml

Innovation. Community. Security.