Prolog features exceptions, which are part of the Prolog ISO standard.
An exception can be thrown with throw/1, and caught with catch/3.
The ISO standard defines many cases in which errors must or may be thrown. The standardized exceptions are all of the form error(E,_), where E indicates the erro...