Next: mpg-ref-once, Previous: mpg-ref-numbervars, Up: mpg-bpr [Contents][Index]
on_exception/3
deprecatedon_exception(-Exception, +ProtectedGoal, +Handler)
same as:
catch(ProtectedGoal, Exception, Handler)
Specify an exception handler for ProtectedGoal, and call ProtectedGoal, as described in ref-ere.
term
callable, must be nonvar
callable, must be nonvar
This predicate has been marked as deprecated since there is another, better and standard-conforming alternative. However, we do not plan to remove it.
Fail on exception:
:- meta_predicate fail_on_exception(0). fail_on_exception(C):- on_exception(E, C, print_exception_then_fail(C, E)). print_exception_then_fail(C, E):- format(user_error, 'Exception occurred while calling ~q:~n', [C]), print_message(warning, E), fail.
Depends on ProtectedGoal and Handler.
None.