Reference
Instances of CImgException are thrown when errors are encountered in a CImg function call.
More...
#include <CImg.h>
Inherits exception.
Inherited by CImgArgumentException, CImgDisplayException, CImgIOException, CImgInstanceException, and CImgWarningException.
Public Member Functions | |
| const char * | what () const throw () |
| Return a C-string containing the error message associated with the thrown exception. | |
Instances of CImgException are thrown when errors are encountered in a CImg function call.
CImgException is the base class of all exceptions thrown by CImg (except CImgAbortException). CImgException is never thrown directly. Derived classes that specify the type of error are thrown instead. These classes can be:
non-derived exception class.CImg function is invalid. This is probably one of the most commonly thrown exceptions in CImg. For instance, the following example throws a CImgArgumentException: CImg function does not meet the function's requirements. For instance, the following example throws a CImgInstanceException: CImgIOException: cimg_strict_warnings is set, and when a CImg function has to display a warning message (see cimg::warn()).It is not recommended to throw CImgException instances manually, as they are intended to be thrown only by the CImg library. When an error occurs in a library function call, CImg may display error messages on the screen or on the standard output, depending on the current CImg exception mode. The CImg exception mode can be queried and set by functions cimg::exception_mode() and cimg::exception_mode(unsigned int).
In all cases, when an error occurs in CImg, an instance of the corresponding exception class is thrown. This may lead the program to break (this is the default behavior), but you can bypass this behavior by handling the exceptions by yourself, using a usual try { ... } catch () { ... } block, as in the following example:
Copyrights (C) From october 2004, David Tschumperlé - GREYC UMR CNRS 6072, Image team.
Copyrights (C) January->September 2004, David Tschumperlé.
Copyrights (C) 2000->2003, David Tschumperlé - INRIA Sophia-Antipolis. Odyssée group.