raise_exception/1
raise_exception(
+Exception)
Raise an exception (that might be intercepted by on_exception/3
).
A call to raise_exception/1
can
never backtrack, fail or succeed. Rather, raise_exception/1
searches for an ancestor of the current goal, ProtectedGoal,
which is of the form:
on_exception(E,ProtectedGoal,Handler)
The first argument, E, unifies with Exception. It then executes the Handler instead of the ProtectedGoal. It will always find a handler at the top level, which prints out a message corresponding to the exception. See ref-msg-tbm for a discussion on how exceptions are printed.
instantiation_error
on_exception/3
.
ref-ere