Module Acutis_internals.Error

All of the error messages.

type t

A message.

val pp : Stdlib.Format.formatter -> t -> unit
exception Acutis_error of t

All of the following functions raise or return this exception.

Lexing and Parsing errors.

val lex_unexpected : Stdlib.Lexing.lexbuf -> char -> _
val lex_bad_int : Stdlib.Lexing.lexbuf -> string -> _
val lex_unterminated_comment : Stdlib.Lexing.lexbuf -> _
val lex_unterminated_string : Stdlib.Lexing.lexbuf -> _
val parse_error : int -> Loc.t -> _

Type errors.

val dup_record_key : Loc.t -> string -> _
val extra_record_tag : Loc.t -> _
val bad_block : Loc.t -> _
val bad_field : Loc.t -> _
val type_mismatch : Loc.t -> (Stdlib.Format.formatter -> 'ty -> unit) -> 'ty -> 'ty -> _
val missing_field : Loc.t -> string -> (Stdlib.Format.formatter -> 'ty -> unit) -> 'ty -> _
val underscore_in_construct : Loc.t -> _
val name_bound_too_many : Loc.t -> string -> _
val var_missing : Loc.t -> string -> _
val var_unused : Loc.t -> string -> _
val pat_num_mismatch : Loc.t -> _
val map_pat_num_mismatch : Loc.t -> _
val component_name_mismatch : Loc.t -> string -> string -> _
val component_extra_prop : Loc.t -> string -> string -> _

Interface errors.

val interface_duplicate : Loc.t -> string -> _
val interface_bad_name : Loc.t -> string -> _
val interface_untagged_union : Loc.t -> _
val interface_unmatched_tags : Loc.t -> string -> string -> _
val interface_duplicate_tag : Loc.t -> (Stdlib.Format.formatter -> 'a -> unit) -> 'a -> _
val interface_open_bool_union : Loc.t -> _
val interface_type_mismatch : Loc.t -> string -> (Stdlib.Format.formatter -> 'ty -> unit) -> 'ty -> 'ty -> _
val interface_missing_prop : Loc.t -> string -> (Stdlib.Format.formatter -> 'ty -> unit) -> 'ty -> _

Matching errors.

val unused_case : Loc.t -> _
val parmatch : Loc.t -> (Stdlib.Format.formatter -> 'a -> unit) -> 'a -> _

Other compile errors.

val duplicate_name : string -> _
val cycle : string list -> exn
val missing_component : string list -> string -> exn

Internal errors.

val internal : __POS__:(string * int * int * int) -> ('a, Stdlib.Format.formatter, unit, _) Stdlib.format4 -> 'a

Use this instead of assert false when an internal invariant breaks. It indicates a bug in the compiler.

val raise_fmt : ('a, Stdlib.Format.formatter, unit, _) Stdlib.format4 -> 'a

Raise a custom message.