package catala

  1. Overview
  2. Docs

Error formatting and helper functions

Error exception and printing

exception StructuredError of string * (string option * Pos.t) list

The payload of the expression is a main error message, with a list of secondary positions related to the error, each carrying an optional secondary message to describe what is pointed by the position.

val print_structured_error : string -> (string option * Pos.t) list -> string

Error exception and printing

val raise_spanned_error : string -> ?span_msg:string -> Pos.t -> 'a
val raise_multispanned_error : string -> (string option * Pos.t) list -> 'a
val raise_error : string -> 'a

Warning printing

val print_multispanned_warning : string -> (string option * Pos.t) list -> unit
val print_spanned_warning : string -> ?span_msg:string -> Pos.t -> unit
val print_warning : string -> unit
OCaml

Innovation. Community. Security.