is_fatal_error.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_IS_FATAL_ERROR_HPP
  8. #define BOOST_MYSQL_IS_FATAL_ERROR_HPP
  9. #include <boost/mysql/error_code.hpp>
  10. #include <boost/mysql/detail/config.hpp>
  11. namespace boost {
  12. namespace mysql {
  13. /**
  14. * \brief Checks whether an error requires re-connection.
  15. * \details
  16. * After an operation on an established connection (like executing a query) fails,
  17. * the connection may be usable for further operations (if the error was non-fatal)
  18. * or not (if the error was fatal). This function determines whether an error
  19. * code returned by a connection operation is fatal or not.
  20. * \n
  21. * To recover from a fatal error code, close and re-establish the connection.
  22. *
  23. * \par Exception safety
  24. * No-throw guarantee.
  25. */
  26. BOOST_MYSQL_DECL
  27. bool is_fatal_error(error_code ec) noexcept;
  28. } // namespace mysql
  29. } // namespace boost
  30. #ifdef BOOST_MYSQL_HEADER_ONLY
  31. #include <boost/mysql/impl/is_fatal_error.ipp>
  32. #endif
  33. #endif