client_errc.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // Copyright (c) 2019-2023 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_CLIENT_ERRC_HPP
  8. #define BOOST_MYSQL_CLIENT_ERRC_HPP
  9. #include <boost/mysql/error_code.hpp>
  10. namespace boost {
  11. namespace mysql {
  12. /**
  13. * \brief MySQL client-defined error codes.
  14. * \details These errors are produced by the client itself, rather than the server.
  15. */
  16. enum class client_errc : int
  17. {
  18. /// An incomplete message was received from the server (indicates a deserialization error or
  19. /// packet mismatch).
  20. incomplete_message = 1,
  21. /// An unexpected value was found in a server-received message (indicates a deserialization
  22. /// error or packet mismatch).
  23. protocol_value_error,
  24. /// The server does not support the minimum required capabilities to establish the connection.
  25. server_unsupported,
  26. /// Unexpected extra bytes at the end of a message were received (indicates a deserialization
  27. /// error or packet mismatch).
  28. extra_bytes,
  29. /// Mismatched sequence numbers (usually caused by a packet mismatch).
  30. sequence_number_mismatch,
  31. /// The user employs an authentication plugin not known to this library.
  32. unknown_auth_plugin,
  33. /// The authentication plugin requires the connection to use SSL.
  34. auth_plugin_requires_ssl,
  35. /// The number of parameters passed to the prepared statement does not match the number of
  36. /// actual parameters.
  37. wrong_num_params,
  38. /// The connection mandatory SSL, but the server doesn't accept SSL connections.
  39. server_doesnt_support_ssl
  40. };
  41. /// Creates an \ref error_code from a \ref client_errc.
  42. inline error_code make_error_code(client_errc error);
  43. } // namespace mysql
  44. } // namespace boost
  45. #include <boost/mysql/impl/error_categories.hpp>
  46. #endif