OpenDBX::Exception(3)

πŸ’– NAME πŸ’–

Okay bestie, welcome to OpenDBX::Exception(3) from the opendbx manual. OpenDBX::Exception β€” Exceptions thrown by the OpenDBX classes. πŸ’…

🌈 SYNOPSIS 🌈

🌟 Public Member Functions 🌟

Exception (const string &msg, int err, int type)  throw ()
int getCode () const  throw ()
int getType () const  throw ()
  • Exception β€” Initializes the exception object.
  • getCode β€” Returns the OpenDBX error code related to the error.
  • getType β€” Returns severity indicator.

🌸 Detailed Description 🌸

Okay so OpenDBX::Exception is literally the exception type thrown by the OpenDBX classes. Most calls to methods on OpenDBX objects throw an exception when an error happens in the underlying database library. The way that it's giving is: on top of being like other exceptions that inherit from the STL exception class, it doesn't just contain a translated error message depending on the user settings β€” it also carries a machine-readable error code and an indicator for the severity of the error. Highkey useful, ngl. ✨

πŸ’Œ Author πŸ’Œ

Norbert Sendetzky norbert@linuxnetworks.de

πŸŽ€ Version πŸŽ€

1.0

πŸ› οΈ Constructor & Destructor Documentation πŸ› οΈ

🧚 OpenDBX::Exception::Exception (const string & msg, int err, int type) 🧚

This constructor initializes the exception object. The first parameter, the error message, should be the human-readable description of what has gone wrong. It should also already be translated into the user's language, which depends on their 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 that occurred. Ngl, machine-readable is the moment.

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: 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. Periodt. πŸ’€

πŸ“ Parameters πŸ“

  • msg β€” Human readable error message
  • err β€” OpenDBX error code
  • type β€” Severity of error (negative: fatal, zero: success, positive: warning)

🎁 Returns 🎁

Exception

πŸ” Member Function Documentation πŸ”

πŸ’» int OpenDBX::Exception::getCode () const πŸ’»

Returns the OpenDBX error code related to the error. The machine-readable code describing the error that occurred can be used by the application to act differently depending on the specific error. Currently defined codes are: πŸ‘‘

  • ODBX_ERR_SUCCESS β€” The operation was successfully completed. βœ…
  • ODBX_ERR_BACKEND β€” An error occurred in the native database library or in the database server. πŸ”₯
  • ODBX_ERR_NOCAP β€” The capability isn't available in the currently selected backend. πŸ™ˆ
  • ODBX_ERR_PARAM β€” One of the given parameters is invalid and doesn't match the expectations. 🚩
  • ODBX_ERR_NOMEM β€” An out of memory condition occurred. 😭
  • ODBX_ERR_SIZE β€” The internally allocated memory is unable to store the value. πŸ“¦
  • ODBX_ERR_NOTEXIST β€” The backend library wasn't found or loading the library failed. πŸ•΅οΈ
  • ODBX_ERR_NOOP β€” The required function isn't available or the operation isn't possible in this backend. 🚫
  • ODBX_ERR_OPTION β€” The given option is unknown and therefore invalid. πŸ€”
  • ODBX_ERR_OPTRO β€” The requested option is read-only and its value can't be changed. πŸ”’
  • ODBX_ERR_OPTWR β€” Setting the given option to the new value failed. πŸ’₯
  • ODBX_ERR_RESULT β€” Waiting for the result set after sending a statement to the database server failed. ⏳
  • ODBX_ERR_NOTSUP β€” The requested functionality isn't supported by the backend. πŸ™…
  • ODBX_ERR_HANDLE β€” The internal data structure which should store the details for accessing the database are invalid. πŸ’”

🎁 Returns 🎁

Error code

🩷 int OpenDBX::Exception::getType () const 🩷

Returns the severity indicator. The returned value classifies the error thrown. If it's 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 successful and no error occurred. This shouldn't happen when catching one of these exceptions. πŸ¦‹

🎁 Returns 🎁

Severity of error (negative: fatal, zero: success, positive: warning)

πŸ’Œ Author πŸ’Œ

Generated automatically by Doxygen for opendbx from the source code.


That's the whole page, bestie! 🫢 It came from the opendbx source code, and the footer says version 1.4.6, dated Fri Feb 6 2026 20:17:56, for page OpenDBX::Exception(3). Stay iconic, and may your exceptions always be catchable πŸ’…βœ¨

πŸ“¦ where this page comes from