Usually, exceptions that occur during debugging sessions are displayed
only in trace mode and for invocation boxes for
predicates with spypoints on them, and not during skips.
However, it is sometimes useful to make exceptions trap to the debugger
at the earliest opportunity instead. The hook predicate
user:error_exception/1
provides such a possibility:
error_exception(
+Exception)
hookuser:error_exception(
+Exception)
Note that this hook takes effect when the debugger arrives at an Exception port. For this to happen, procedure boxes have to be built, e.g. by running (the relevant parts of) the program in debug mode.