Source file error.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
type t =
  | Decrypt_failed
  | Nonce_exhausted
  | Invalid_state of string
  | Bad_message_length of { max : int; got : int }
  | Bad_psk of string
  | Unsupported_primitive of string
  | DH_error of string

let pp ppf = function
  | Decrypt_failed -> Format.pp_print_string ppf "decrypt_failed"
  | Nonce_exhausted -> Format.pp_print_string ppf "nonce_exhausted"
  | Invalid_state s -> Format.fprintf ppf "invalid_state: %s" s
  | Bad_message_length { max; got } ->
      Format.fprintf ppf "bad_message_length: max=%d got=%d" max got
  | Bad_psk s -> Format.fprintf ppf "bad_psk: %s" s
  | Unsupported_primitive s -> Format.fprintf ppf "unsupported_primitive: %s" s
  | DH_error s -> Format.fprintf ppf "dh_error: %s" s