catch(Goal,ExceptionPattern,Recovergoal)
which is equivalent to Goal except when an exception is raised during the execution of Goal that unifies ExceptionPattern. When such an exception is raised, all the bindings that have been performed on variables in Goal will be undone and Recovergoal will be executed to handle the exception. Notice that ExceptionPattern is unified with a renamed copy of the exception before Recovergoal is executed. Notice also that only exceptions that are raised by a descendant call of Goal can be caught.