Prolog features exceptions, which are part of the Prolog ISO standard.
An exception can be thrown with
throw/1, and caught with
The ISO standard defines many cases in which errors must or may be thrown. The standardized exceptions are all of the form
E indicates the error. Examples are
type_error, which see.
An important predicate in connection with exceptions is
setup_call_cleanup/3, which see.