jon.recoil.org

Module Odoc_model.ErrorSource

Sourcetype t
Sourceval enable_missing_root_warning : bool Stdlib.ref
Sourceval make : ?suggestion:string -> ('a, Stdlib.Format.formatter, unit, Odoc_model.Location_.span -> Odoc_model.Error.t) Stdlib.format4 -> 'a
Sourceval filename_only : ?suggestion:string -> ('a, Stdlib.Format.formatter, unit, string -> Odoc_model.Error.t) Stdlib.format4 -> 'a
Sourceval to_string : Odoc_model.Error.t -> string
Sourceval raise_exception : Odoc_model.Error.t -> _

Raise a t as an exception. Can be caught with catch or catch_errors_and_warnings.

Sourceval catch : (unit -> 'a) -> ('a, Odoc_model.Error.t) Stdlib.result
Sourcetype 'a with_warnings
Sourceval raise_warning : ?non_fatal:bool -> Odoc_model.Error.t -> unit

Raise a warning that need to be caught with catch_warnings. non_fatal is false by default.

Sourceval raise_warnings : 'a Odoc_model.Error.with_warnings -> 'a

Accumulate warnings into a global variable. See catch_warnings.

Sourceval catch_warnings : (unit -> 'a) -> 'a Odoc_model.Error.with_warnings

Catch warnings accumulated by raise_warning. Safe to nest.

Subtype of with_warnings.

Sourceval raise_errors_and_warnings : 'a Odoc_model.Error.with_errors_and_warnings -> 'a
Sourceval catch_errors_and_warnings : (unit -> 'a) -> 'a Odoc_model.Error.with_errors_and_warnings

Combination of catch and catch_warnings.

Sourcetype warnings_options = {
  1. warn_error : bool;
    (*

    If true, warnings will result in an error.

    *)
  2. print_warnings : bool;
    (*

    Whether to print warnings.

    *)
  3. warnings_tag : string option;
    (*

    Whether to tag references to filter them later.

    *)
}
Sourceval handle_warnings : warnings_options:Odoc_model.Error.warnings_options -> 'a Odoc_model.Error.with_warnings -> ('a, [> `Msg of string ]) Stdlib.result

Print warnings to stderr. If warn_error is true and there was warnings, returns an Error.

Sourceval handle_errors_and_warnings : warnings_options:Odoc_model.Error.warnings_options -> 'a Odoc_model.Error.with_errors_and_warnings -> ('a, [> `Msg of string ]) Stdlib.result

Like handle_warnings but works on the output of catch_errors_and_warnings. Error case is converted into a `Msg.

Sourceval print_errors : Odoc_model.Error.t list -> unit

Used internally by handle_warnings.

Sourceval unpack_warnings : 'a Odoc_model.Error.with_warnings -> 'a * Odoc_model.Error.t list

Convert a parsing error into a t.

Sourceval raise_parser_warnings : Odoc_parser.t -> Odoc_parser.Ast.t

Like raise_warnings but handle parsing errors.