28 #ifndef WEBSOCKETPP_ERROR_HPP
29 #define WEBSOCKETPP_ERROR_HPP
33 #include <websocketpp/common/cpp11.hpp>
34 #include <websocketpp/common/system_error.hpp>
133 char const * name()
const _WEBSOCKETPP_NOEXCEPT_TOKEN_ {
134 return "websocketpp";
137 std::string message(
int value)
const {
140 return "Generic error";
142 return "send queue full";
144 return "payload violation";
146 return "endpoint not secure";
148 return "endpoint not available";
150 return "invalid uri";
152 return "no outgoing message buffers";
154 return "no incoming message buffers";
156 return "invalid state";
158 return "Unable to extract close code";
160 return "Extracted close code is in an invalid range";
162 return "Extracted close code is in a reserved range";
164 return "Invalid UTF-8";
166 return "Invalid subprotocol";
168 return "Bad Connection";
172 return "Connection creation attempt failed";
174 return "Selected subprotocol was not requested by the client";
176 return "Feature not available on server endpoints";
178 return "Feature not available on client endpoints";
180 return "HTTP connection ended";
182 return "The opening handshake timed out";
184 return "The closing handshake timed out";
186 return "Invalid URI port";
188 return "Async Accept not listening";
190 return "Operation canceled";
197 inline const lib::error_category& get_category() {
202 inline lib::error_code make_error_code(
error::value e) {
203 return lib::error_code(static_cast<int>(e), get_category());
209 _WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_
212 static bool const value =
true;
214 _WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
221 : m_msg(msg), m_code(p_code) {}
225 virtual char const * what()
const throw() {
226 return m_msg.c_str();
239 #endif // WEBSOCKETPP_ERROR_HPP
uint16_t value
The type of a close code value.
Attempted to use a client specific feature on a server endpoint.
std::pair< lib::error_code, std::string > err_str_pair
Combination error code / string type for returning two values.
Selected subprotocol was not requested by the client.
Unable to parse close code.
Close code is in a reserved range.
The connection was in the wrong state for this operation.
Namespace for the WebSocket++ project.
The requested operation was canceled.
The endpoint is out of incoming message buffers.
send attempted when endpoint write queue was full
The endpoint is out of outgoing message buffers.
WebSocket close handshake timed out.
WebSocket opening handshake timed out.
Attempted to use a server specific feature on a client endpoint.
Attempted to open a secure connection with an insecure endpoint.
Unit testing utility error code.
An invalid uri was supplied.
Connection creation attempted failed.