It is possible to protect a part of a program against abrupt termination in the event of an exception. There are two ways to do this:
on_exception/3
user:unknown_predicate_handler/3