Catala_utils.Errors
Error formatting and helper functions
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 :
?is_warning:bool ->
string ->
(string option * Pos.t) list ->
unit
Emits error or warning if is_warning
is set to true
.
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 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