Availability:built-in
[ISO]catch(:Goal,
+Catcher, :Recover)
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.