package codept-lib

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

Module FaultSource

Fault definitions and associated polycy

Sourcemodule Level : sig ... end
Sourcetype explanation = string
Sourcetype 'data tag

Fault definition

Sourcetype 'data info = {
  1. tag : 'data tag;
  2. path : string list;
    (*

    hierarchical name for the fault

    *)
  3. expl : explanation;
    (*

    fault documentation

    *)
  4. printer : Format.formatter -> 'data -> unit;
}
Sourcetype 'a printer = Format.formatter -> 'a -> unit
Sourceval info : string list -> explanation -> 'data printer -> 'data info
Sourcetype fault =
  1. | Err : 'data tag * 'data -> fault
Sourcetype value =
  1. | Fmt : 'data printer * 'data -> value
Sourcetype t = fault
Sourceexception Fatal of value

When an error is critic (see Level.critical), we raise this exception which contains the value that describes the critical problem which its pretty-printer.

Sourceval emit : 'data info -> 'data -> t
Sourcetype log_info = {
  1. silent : Level.t;
  2. level : Level.t;
  3. exit : Level.t;
}

Basic logging function

Sourceval log : log_info -> 'a printer -> 'a printer
Sourcemodule Log : sig ... end

Fixed level logging functions

Sourcemodule Policy : sig ... end

Fault handling polycy

Sourcetype handler = {
  1. policy : Policy.t;
  2. err_formatter : Format.formatter;
}
Sourceval register : ?lvl:Level.t -> 'a info -> Policy.t -> Policy.t

Fault handling with policy

Sourceval handle : handler -> fault -> unit
Sourceval raise : handler -> 'a info -> 'a -> unit
Sourceval is_silent : Policy.t -> 'a info -> bool
OCaml

Innovation. Community. Security.