Next: mpg-ref-char_code, Previous: mpg-ref-callable, Up: mpg-bpr [Contents][Index]
catch/3
ISOcatch(+ProtectedGoal, -Exception, +Handler)
Specify an exception handler for ProtectedGoal, and call ProtectedGoal, as described in ref-ere.
callable, must be nonvar
term
callable, must be nonvar
Fail on exception:
:- meta_predicate fail_on_exception(0). fail_on_exception(C):- catch(C, E, print_exception_then_fail(C, E)). print_exception_then_fail(C, E) :- format(user_error, 'Exception occured while calling ~q:~n', [C]), print_message(warning, E), fail.
Depends on ProtectedGoal and Handler.
None.