This subclass of PlTerm is used to represent exceptions. Currently defined methods are:
...; try { PlCall("consult(load)"); } catch ( PlException &ex ) { cerr << (char *) ex << endl; }
error(type_error(Expected, Actual)
, Context)
PlException::cppThrow() throws a PlTypeEror exception. This ensures consistency in the exception-class whether the exception is generated by the C++-interface or returned by Prolog.
The following example illustrates this behaviour:
PREDICATE(call_atom, 1) { try { return PlCall((char *)A1); } catch ( PlTypeError &ex ) { cerr << "Type Error caugth in C++" << endl; cerr << "Message: \"" << (char *)ex << "\"" << endl; return FALSE; } }