The VError class is the class thrown by the VIPS C++ API when an error is detected. It is derived from std::exception in the usual way.
There are two constructors for VError:
The first form creates an error object initialised with the specified string, the last form creates an empty error object.
A function gives access to the string held by VError:
You can also send to an ostream.
Two member functions let you append elements to an error:
For example:
will throw a VError with a diagnostic of:
The member function perror() prints the error message to stdout and exits with a code of 1.
The convenience function verror creates an VError with the specified error string, and throws it. If you pass "" for the string, verror uses the contents of the VIPS error buffer instead.