(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
(** This modules implements basic manipulations of errors for use
throughout Rocq's code. *)
(** {6 Error handling} *)
val push : exn -> Exninfo.iexn
[@@ocaml.deprecated "(8.12) please use [Exninfo.capture]"]
val anomaly : ?loc:Loc.t -> ?info:Exninfo.info -> ?label:string -> Pp.t -> 'a (** Raise an anomaly, with an optional location and an optional
label identifying the anomaly. *)
val is_anomaly : exn -> bool (** Check whether a given exception is an anomaly. Thisismostlyprovidedforcompatibility.Pleaseavoiddoingspecific
tricks with anomalies thanks to it. See rather [noncritical] below. *)
exception UserError of Pp.t (** Main error signaling exception. It carries a header plus a pretty printing
doc *)
val user_err : ?loc:Loc.t -> ?info:Exninfo.info -> Pp.t -> 'a (** Main error raising primitive. [user_err ?loc pp] signals an
error [pp] with optional header and location [loc] *)
exception Timeout
(** [register_handler h] registers [h] as a handler. Whenanexpressionisprintedwith[printe],it goesthroughallregisteredhandles(themost recentfirst)untilahandledealswithit.
val register_handler : (exn -> Pp.t option) -> unit
(** The standard exception printer *) valprint : exn -> Pp.t val iprint : Exninfo.iexn -> Pp.t
(** Same as [print], except that the "Please report" part of an anomaly
isn't printed (used in Ltac debugging). *) val print_no_report : exn -> Pp.t val iprint_no_report : Exninfo.iexn -> Pp.t
(** "Critical" exceptions, such as anomalies or interruptions should notbecaughtandignoredbymistakebyinnerRocqfunctionsby meansofdoinga"catch-all".Theyshouldbehandledinsteadby thecompilerlayerwhichisinchargeofcoordinatingthe intepretationofRocqvernaculars.
(** Register a printer for errors carrying additional information on exceptions.Thismethodisfragileandshouldbeconsidered
deprecated *) val register_additional_error_info
: (Exninfo.info -> Pp.t option)
-> unit
(** [to_result ~f x] reifies (non-critical) exceptions into a [('a,
iexn) Result.t] type *) val to_result : f:('a -> 'b) -> 'a -> ('b, Exninfo.iexn) Result.t
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.