class ErrorExceptionerror
function, which makes it possible for clients to respond to error
conditions. Typical code for catching errors looks like this:
try {
. . . code in which an error might occur . . .
} catch (ErrorException & ex) {
. . . code to handle the error condition . . .
}
If an ErrorException is thrown at any point in the
range of the try (including in functions called from
that code), control will jump immediately to the error handler.
| Function | |
| error(msg) | Signals an error condition in a program by throwing an ErrorException with the specified message. |
void error(string str);
ErrorException with the specified message.
Usage:
error(msg);