The functions and classes in this library usually throw exceptions of Exception class (defined in cel_exception.h) except some special case.
Since all the codes that throw the exceptions also set appropriate error codes and messages to the Exception instances using celThrow or celThrow2 and you can get the information by Exception::what() and/or Exception::getError(). The following code illustrates the typical case for catching the exceptions:
The error message obtained by Exception::what() contains the source code point that throws the exception. And it is very useful when you're debugging the code or reporting bugs of the library to us.
Since Exception class inherits the std::exception class, you can also write the code like the following one:
On UNIX platforms, since gcc does not care about C++ exception frame, exceptions might be lost during round-tripping through pure C libraries. Because of such issues, this library is linked against our own version of several libraries instead of using system provided one. Fore more information, see Special Version of Libraries for Exception Handling.