bad_field_access.hpp 719 B

12345678910111213141516171819202122232425262728
  1. //
  2. // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_BAD_FIELD_ACCESS_HPP
  8. #define BOOST_MYSQL_BAD_FIELD_ACCESS_HPP
  9. #include <exception>
  10. namespace boost {
  11. namespace mysql {
  12. /// Exception type thrown when trying to access a \ref field
  13. /// or \ref field_view with an incorrect type.
  14. class bad_field_access : public std::exception
  15. {
  16. public:
  17. /// Returns the error message.
  18. const char* what() const noexcept override { return "bad_value_access"; }
  19. };
  20. } // namespace mysql
  21. } // namespace boost
  22. #endif