package lambdapi
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d01e5f13db2eaba6e4fe330667149e0059d4886c651ff9d6b672db2dfc9765ed
sha512=33b68c972aca37985ed73c527076198e7d4961c7e27c89cdabfe4d1cff97cd41ccfb85ae9499eb98ad9a0aefd920bc55555df6393fc441ac2429e4d99cddafa8
doc/lambdapi.common/Common/Error/index.html
Module Common.Error
Source
Warnings and errors.
err_fmt
warning/error output formatter.
wrn popt fmt
prints a yellow warning message with Format
format fmt
. Note that the output buffer is flushed by the function, and that output is prefixed with the position popt
if given. A newline is automatically put at the end of the message as well.
with_no_wrn f x
disables warnings before executing f x
and then restores the initial state of warnings. The result of f x
is returned.
Exception raised in case of failure. Note that we use an optional optional source position. None
is used on errors that are independant from source code position (e.g., errors related to command-line arguments parsing). In cases where positions are expected Some None
may be used to indicate the abscence of a position. This may happen when terms are generated (e.g., by a form of desugaring).
fatal_str fmt
may be called an arbitrary number of times to build up the error message of the fatal
or fatal_no_pos
functions prior to calling them. Note that the messages are stored in a buffer that is flushed by the fatal
or fatal_no_pos
function. Hence, they must be called.
fatal popt fmt
raises the Fatal(popt,msg)
exception, in which msg
is built from the format fmt
(provided the necessary arguments).
fatal_no_pos fmt
is similar to fatal _ fmt
, but it is used to raise an error that has no precise attached source code position.
handle_exceptions f
runs f ()
in an exception handler and handles both expected and unexpected exceptions by displaying a graceful error message. In case of an error, the program is (irrecoverably) stopped with exit code 1
(indicating failure). Hence, handle_exceptions
should only be called by the main program logic, not by the internals.