As of version 9.3.13, constraints (attributed variables) in Catcher are respected. If evaluating the constraint raises an exception, the most urgent exception is preserved (see section 4.10.2) and searching for a matching catch/3 call is continued. If both exceptions are equally urgent, the exception raised by the constraint evaluation is preserved.
The overhead of calling a goal through catch/3
is comparable to
call/1.
Recovery from an exception is much slower, especially if the exception
term is large due to the copying thereof or is decorated with a stack
trace using, e.g., the library library(prolog_stack)
based
on the
prolog_exception_hook/4
hook predicate to rewrite exceptions.