package ppxlib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t = Ocaml_common.Location.t = {
  1. loc_start : Stdlib.Lexing.position;
  2. loc_end : Stdlib.Lexing.position;
  3. loc_ghost : bool;
}
type 'a loc = 'a Ocaml_common.Location.loc = {
  1. txt : 'a;
  2. loc : t;
}
module Error : sig ... end
val set_input_name : string -> unit
val none : t

Automatically reporting errors for raised exceptions

val register_error_of_exn : (exn -> Error.t option) -> unit

Each compiler module which defines a custom type of exception which can surface as a user-visible error should register a "printer" for this exception using register_error_of_exn. The result of the printer is an error value containing a location, a message, and optionally sub-messages (each of them being located as well).

val raise_errorf : ?loc:t -> ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val report_exception : Stdlib.Format.formatter -> exn -> unit

Reraise the exception if it is unknown.

exception Error of Error.t

Raising Error e signals an error e; the exception will be caught and the error will be printed.

OCaml

Innovation. Community. Security.