2018-02-06 14:39:03 +00:00
|
|
|
(** Error reporting *)
|
|
|
|
|
|
|
|
(** Captures the backtrace and report an error.
|
|
|
|
|
2018-02-23 09:17:37 +00:00
|
|
|
Because jbuilder doesn't stop at the first error, it might end up
|
|
|
|
reporting the same error twice about missing libraries for
|
|
|
|
instance. To avoid this, we keep a cache of reported errors and
|
|
|
|
ignore errors that have already been reported.
|
2018-02-06 14:39:03 +00:00
|
|
|
|
2018-02-23 09:17:37 +00:00
|
|
|
We cache what is actually printed to the screen. *)
|
2018-02-06 14:39:03 +00:00
|
|
|
val report : exn -> unit
|
|
|
|
|
2018-02-23 09:17:37 +00:00
|
|
|
type printer =
|
|
|
|
{ loc : Loc.t option
|
|
|
|
; pp : Format.formatter -> unit
|
|
|
|
; hint : string option
|
|
|
|
; backtrace : bool
|
|
|
|
}
|
|
|
|
|
|
|
|
(** Register an error reporter. *)
|
|
|
|
val register : (exn -> printer option) -> unit
|
2018-02-20 11:46:10 +00:00
|
|
|
|
2018-02-06 14:39:03 +00:00
|
|
|
(**/**)
|
|
|
|
val map_fname : (string -> string) ref
|