2.16.1 The class PlException (version 2)
This subclass of PlTerm
is used to represent exceptions.
Currently defined methods are:
- PlException :: PlException(const PlTerm &)
- Create an exception from a general Prolog term. This provides the interface for throwing any Prolog terms as an exception.
- std::string as_string()
- The exception is translated into a message as produced by
print_message/2.
The character data is stored in a ring. Example:
...; try { PlCall("consult(load)"); } catch ( PlException& ex ) { cerr << ex.as_string() << endl; }
- int plThrow()
- Used in the PREDICATE() wrapper to pass the exception to Prolog.
See
PL_raise_exeption().