package ppx_core

  1. Overview
  2. Docs
type t = Ocaml_common.Location.error
val createf : loc:Location.t -> ('a, Caml.Format.formatter, Base.Unit.t, t) Pervasives.format4 -> 'a
val message : t -> Base.String.t
val set_message : t -> Base.String.t -> t
val register_error_of_exn : (Base.Exn.t -> t Base.Option.t) -> Base.Unit.t

Register an exception handler. Exception registered this way will be properly displayed by report_exception.

val of_exn : Base.Exn.t -> [ `Ok of t | `Already_displayed ] Base.Option.t
val to_extension : t -> string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload

Convert an error to an extension point. The compiler recognizes this and displays the error properly.

OCaml

Innovation. Community. Security.