package catala

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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 : ?span_msg:string -> Pos.t -> ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val raise_multispanned_error : (string option * Pos.t) list -> ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val raise_error : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a

Warning printing

val format_multispanned_warning : (string option * Pos.t) list -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val format_spanned_warning : ?span_msg:string -> Pos.t -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val format_warning : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a