| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- /* Copyright (c) 2018-2024 Marcelo Zimbres Silva (mzimbres@gmail.com)
- *
- * Distributed under the Boost Software License, Version 1.0. (See
- * accompanying file LICENSE.txt)
- */
- #ifndef BOOST_REDIS_ERROR_HPP
- #define BOOST_REDIS_ERROR_HPP
- #include <boost/system/error_code.hpp>
- namespace boost::redis {
- /// Generic errors.
- enum class error
- {
- /// Invalid RESP3 type.
- invalid_data_type = 1,
- /// Can't parse the string as a number.
- not_a_number,
- /// The maximum depth of a nested response was exceeded.
- exceeeds_max_nested_depth,
- /// Got non boolean value.
- unexpected_bool_value,
- /// Expected field value is empty.
- empty_field,
- /// Expects a simple RESP3 type but got an aggregate.
- expects_resp3_simple_type,
- /// Expects aggregate.
- expects_resp3_aggregate,
- /// Expects a map but got other aggregate.
- expects_resp3_map,
- /// Expects a set aggregate but got something else.
- expects_resp3_set,
- /// Nested response not supported.
- nested_aggregate_not_supported,
- /// Got RESP3 simple error.
- resp3_simple_error,
- /// Got RESP3 blob_error.
- resp3_blob_error,
- /// Aggregate container has incompatible size.
- incompatible_size,
- /// Not a double
- not_a_double,
- /// Got RESP3 null.
- resp3_null,
- /// There is no stablished connection.
- not_connected,
- /// Resolve timeout
- resolve_timeout,
- /// Connect timeout
- connect_timeout,
- /// The server didn't answer the health checks on time and didn't send any data during the health check period.
- pong_timeout,
- /// SSL handshake timeout
- ssl_handshake_timeout,
- /// Can't receive push synchronously without blocking
- sync_receive_push_failed,
- /// Incompatible node depth.
- incompatible_node_depth,
- /// The setup request sent during connection establishment failed (the name is historical).
- resp3_hello,
- /// The configuration specified a UNIX socket address, but UNIX sockets are not supported by the system.
- unix_sockets_unsupported,
- /// The configuration specified UNIX sockets with SSL, which is not supported.
- unix_sockets_ssl_unsupported,
- /// Reading data from the socket would exceed the maximum size allowed of the read buffer.
- exceeds_maximum_read_buffer_size,
- /// Timeout while writing data to the server.
- write_timeout,
- };
- /**
- * @brief Creates a error_code object from an error.
- *
- * @param e Error code.
- */
- auto make_error_code(error e) -> system::error_code;
- } // namespace boost::redis
- namespace std {
- template <>
- struct is_error_code_enum<::boost::redis::error> : std::true_type { };
- } // namespace std
- #endif // BOOST_REDIS_ERROR_HPP
|