Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

46 рядки
1.0 KiB

  1. #pragma once
  2. #include <cppcore/misc/exception.h>
  3. #include <cppmariadb/config.h>
  4. #include <cppmariadb/enums.h>
  5. namespace cppmariadb
  6. {
  7. /**
  8. * @brief Exception class used for all mariadb errors.
  9. */
  10. struct exception
  11. : public ::cppcore::exception
  12. {
  13. public:
  14. error_code error; //!< Error code.
  15. std::string query; //!< Erroneous query.
  16. public:
  17. /**
  18. * @brief Constructor. Create an exception object.
  19. *
  20. * @param[in] msg Exception message.
  21. * @param[in] err Error code.
  22. * @param[in] q Erroneous query.
  23. */
  24. inline exception(
  25. const std::string& msg,
  26. error_code err,
  27. const std::string& q = std::string());
  28. protected:
  29. /**
  30. * @brief Print the message of the exception to the passed stream.
  31. *
  32. * @param[in] os Stream to print message of the exception to.
  33. */
  34. void print_message(std::ostream& os) const override;
  35. };
  36. }
  37. #include "exception.inl"