.TH "OpenDBX::Exception" 3 "Wed Apr 3 2024 11:07:55" "Version 1.4.6" "opendbx" \" -*- nroff -*- .ad l .nh .SH NAME OpenDBX::Exception \- Exceptions thrown by the \fBOpenDBX\fP classes\&. .SH SYNOPSIS .br .PP .PP Inherits std::runtime_error\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBException\fP (const string &msg, int err, int type) throw ()" .br .RI "Initializes the exception object\&. " .ti -1c .RI "int \fBgetCode\fP () const throw ()" .br .RI "Returns the \fBOpenDBX\fP error code related to the error\&. " .ti -1c .RI "int \fBgetType\fP () const throw ()" .br .RI "Returns severity indicator\&. " .in -1c .SH "Detailed Description" .PP Exceptions thrown by the \fBOpenDBX\fP classes\&. Most calls to methods of \fBOpenDBX\fP 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\&. .PP \fBAuthor\fP .RS 4 Norbert Sendetzky norbert@linuxnetworks.de .RE .PP \fBVersion\fP .RS 4 1\&.0 .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "OpenDBX::Exception::Exception (const string & msg, int err, int type)" .PP 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 \fBOpenDBX\fP C++ library are already translated\&. .PP The \fBOpenDBX\fP error code is the machine readable code for the error which has been occured\&. .PP 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\&. .PP \fBParameters\fP .RS 4 \fImsg\fP Human readable error message .br \fIerr\fP \fBOpenDBX\fP error code .br \fItype\fP Severity of error (negative: fatal, zero: success, positive: warning) .RE .PP \fBReturns\fP .RS 4 \fBException\fP .RE .PP .SH "Member Function Documentation" .PP .SS "int OpenDBX::Exception::getCode () const" .PP Returns the \fBOpenDBX\fP 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: .PP .IP "\(bu" 2 ODBX_ERR_SUCCESS .br The operation was successfully completed\&. .IP "\(bu" 2 ODBX_ERR_BACKEND .br An error occured in the native database library or in the database server\&. .IP "\(bu" 2 ODBX_ERR_NOCAP .br The capability isn't available in the currently selected backend\&. .IP "\(bu" 2 ODBX_ERR_PARAM .br One of the given parameters is invalid and doesn't match the expectations\&. .IP "\(bu" 2 ODBX_ERR_NOMEM .br An out of memory condition occured\&. .IP "\(bu" 2 ODBX_ERR_SIZE .br The internally allocated memory is unable to store the value\&. .IP "\(bu" 2 ODBX_ERR_NOTEXIST .br The backend library wasn't found or loading the library failed\&. .IP "\(bu" 2 ODBX_ERR_NOOP .br The required function isn't available or the operation isn't possible in this backend\&. .IP "\(bu" 2 ODBX_ERR_OPTION .br The given option is unknown an therefore invalid\&. .IP "\(bu" 2 ODBX_ERR_OPTRO .br The requested option is read-only and its value can't be changed\&. .IP "\(bu" 2 ODBX_ERR_OPTWR .br Setting the given option to the new value failed\&. .IP "\(bu" 2 ODBX_ERR_RESULT .br Waiting for the result set after sending a statement to the database server failed\&. .IP "\(bu" 2 ODBX_ERR_NOTSUP .br The requested functionality isn't supported by the backend\&. .IP "\(bu" 2 ODBX_ERR_HANDLE .br The internal data structure which should store the details for accessing the database are invalid\&. .PP .PP \fBReturns\fP .RS 4 Error code .RE .PP .SS "int OpenDBX::Exception::getType () const" .PP 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\&. .PP 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\&. .PP \fBReturns\fP .RS 4 Severity of error (negative: fatal, zero: success, positive: warning) .RE .PP .SH "Author" .PP Generated automatically by Doxygen for opendbx from the source code\&.