|Did you know ...
resource_error exceptions. Some return
domain_error exceptions. A call to Prolog using
may return any exception, including those thrown by explicit calls to throw/1.
If no exception is pending this function returns
Note that an API may only raise an exception when it fails; if the
API call succeeds, the result of
will be 0.230Provided no exception
was pending before calling the API function. As clients must deal with
exceptions immediately after an API call raises one, this can not happen
in a well behaved client. The implementation of a foreign
predicate should normally cleanup and return
FALSE after an exception is raised (and typically also
after an API call failed for logical reasons; see PL_unify()
for an elaboration on this topic). If the call to Prolog is not the
implementation of a foreign predicate, e.g., when the overall process
control is in some other language, exceptions may be printed by calling print_message/2
and should be discarded by calling PL_clear_exception().