Source file user_error.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
exception E of User_message.t
let prefix =
Pp.seq (Pp.tag User_message.Style.Error (Pp.verbatim "Error")) (Pp.char ':')
let make ?loc ?hints paragraphs =
User_message.make ?loc ?hints paragraphs ~prefix
let raise ?loc ?hints paragraphs = raise (E (make ?loc ?hints paragraphs))
let () =
Printexc.register_printer (function
| E t -> Some (Format.asprintf "%a@?" Pp.to_fmt (User_message.pp t))
| _ -> None)