module Warning: sig
.. end
Contextual Errors
module SELF: sig
.. end
include SELF
module Map: FCMap.Make
(
SELF
)
module Set: FCSet.Make
(
SELF
)
val severe : Set.t -> bool
val pretty : Format.formatter -> t -> unit
type
collector = {
|
default : string ; |
|
mutable warnings : Set.t ; |
}
val collector : collector Context.value
val default : unit -> string
exception Error of string * string
Source, Reason
val error : ?source:string -> ('a, Format.formatter, unit, 'b) Pervasives.format4 -> 'a
type
context = collector option
val context : ?source:string -> unit -> collector option
val flush : collector option -> Set.t
val add : t -> unit
val emit : ?severe:bool ->
?source:string ->
effect:string -> ('a, Format.formatter, unit, unit) Pervasives.format4 -> 'a
Emit a warning in current context.
Defaults: severe=true
, source="wp"
.
val handle : ?severe:bool -> effect:string -> handler:('a -> 'b) -> ('a -> 'b) -> 'a -> 'b
Handle the error and emit a warning with specified severity and effect
if a context has been set.
Otherwise, a WP-fatal error is raised instead.
Default for severe
is false.
type 'a
outcome =
| |
Result of Set.t * 'a |
| |
Failed of Set.t |
val catch : ?source:string ->
?severe:bool -> effect:string -> ('a -> 'b) -> 'a -> 'b outcome
Set up a context for the job. If non-handled errors are raised,
then a warning is emitted with specified severity and effect.
Default for severe
is true
.