28#ifndef WEBSOCKETPP_ERROR_HPP
29#define WEBSOCKETPP_ERROR_HPP
155 return "websocketpp";
161 return "Generic error";
163 return "send queue full";
165 return "payload violation";
167 return "endpoint not secure";
169 return "endpoint not available";
171 return "invalid uri";
173 return "no outgoing message buffers";
175 return "no incoming message buffers";
177 return "invalid state";
179 return "Unable to extract close code";
181 return "Extracted close code is in an invalid range";
183 return "Extracted close code is in a reserved range";
185 return "Invalid UTF-8";
187 return "Invalid subprotocol";
189 return "Bad Connection";
193 return "Connection creation attempt failed";
195 return "Selected subprotocol was not requested by the client";
197 return "Feature not available on server endpoints";
199 return "Feature not available on client endpoints";
201 return "HTTP connection ended";
203 return "The opening handshake timed out";
205 return "The closing handshake timed out";
207 return "Invalid URI port";
209 return "Async Accept not listening";
211 return "Operation canceled";
213 return "Connection rejected";
215 return "Upgrade required";
217 return "Invalid version";
219 return "Unsupported version";
221 return "HTTP parse error";
223 return "Extension negotiation failed";
236 return lib::error_code(
static_cast<int>(e),
get_category());
254 :
m_msg(msg.empty() ? ec.message() : msg),
m_code(ec)
263 virtual char const *
what()
const throw() {
264 return m_msg.c_str();
267 lib::error_code
code()
const throw() {
char const * name() const _WEBSOCKETPP_NOEXCEPT_TOKEN_
std::string message(int value) const
lib::error_code code() const
virtual char const * what() const
exception(lib::error_code ec)
exception(std::string const &msg, lib::error_code ec=make_error_code(error::general))
#define _WEBSOCKETPP_NOEXCEPT_TOKEN_
@ general
Catch-all library error.
@ unrequested_subprotocol
Selected subprotocol was not requested by the client.
@ invalid_port
Invalid port in URI.
@ client_only
Attempted to use a client specific feature on a server endpoint.
@ http_connection_ended
HTTP connection ended.
@ async_accept_not_listening
@ operation_canceled
The requested operation was canceled.
@ no_outgoing_buffers
The endpoint is out of outgoing message buffers.
@ http_parse_error
HTTP parse error.
@ reserved_close_code
Close code is in a reserved range.
@ con_creation_failed
Connection creation attempted failed.
@ no_incoming_buffers
The endpoint is out of incoming message buffers.
@ invalid_state
The connection was in the wrong state for this operation.
@ extension_neg_failed
Extension negotiation failed.
@ rejected
Connection rejected.
@ unsupported_version
Unsupported WebSocket protocol version.
@ invalid_utf8
Invalid UTF-8.
@ invalid_close_code
Close code is invalid.
@ server_only
Attempted to use a server specific feature on a client endpoint.
@ endpoint_not_secure
Attempted to open a secure connection with an insecure endpoint.
@ close_handshake_timeout
WebSocket close handshake timed out.
@ invalid_subprotocol
Invalid subprotocol.
@ bad_close_code
Unable to parse close code.
@ open_handshake_timeout
WebSocket opening handshake timed out.
@ invalid_version
Invalid WebSocket protocol version.
@ send_queue_full
send attempted when endpoint write queue was full
@ test
Unit testing utility error code.
@ invalid_uri
An invalid uri was supplied.
lib::error_code make_error_code(error::value e)
const lib::error_category & get_category()
Namespace for the WebSocket++ project.
std::pair< lib::error_code, std::string > err_str_pair
Combination error code / string type for returning two values.
#define _WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
#define _WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_