OpenDBX::Exception(3) | opendbx | OpenDBX::Exception(3) |
OpenDBX::Exception - Exceptions thrown by the OpenDBX classes.
Inherits runtime_error.
Exception (const string &msg, int err, int type) throw
()
Initializes the exception object. int getCode () const throw ()
Returns the OpenDBX error code related to the error. int getType
() const throw ()
Returns severity indicator.
Exceptions thrown by the OpenDBX classes.
Most calls to methods of OpenDBX objects does throw an exception in case an error occurs in the underlying database library. Additionally to other exceptions which inherit from the STL exception class it will not only contain a translated error message depending on the user settings but also a machine readable error code and an indicator for the severity of the eror.
Author
Version
Initializes the exception object. The first parameter, the error message, should be the human readable description of what has gone wrong. It should also be already translated to the language of the user which depends on his environment settings when e.g GNU gettext is used. Errors thrown by the OpenDBX C++ library are already translated.
The OpenDBX error code is the machine readable code for the error which has been occured.
The last parameter must be a value indicating the severity of the thrown error. If the value is smaller than zero, the error is fatal and the connection to the database can't be recovered and has to be closed and reopened before the application can try to continue. In case it's greater than zero, the operation failed but the database connection is still usable. Zero represents a successful operation and shouldn't be used because an exception should only be thrown in error conditions.
Parameters
Returns
Returns the OpenDBX error code related to the error. The machine readable code describing the error which occured can be used by the application to act differently depending on the specific error. Currently defined codes are:
Returns
Returns severity indicator. The returned value classifies the error thrown. In case it is negative, the error is fatal (e.g. the connection to the database is lost) and the application can't continue without closing and reopening the connection.
If the value is positive, the database wasn't able to perform the requested action but the connection is still OK and can be used to send more requests to the database. On zero, everything was successfull and no error occured. This shouldn't happen when catching one of these exceptions.
Returns
Generated automatically by Doxygen for opendbx from the source code.
Fri Nov 20 2020 | Version 1.4.6 |