Refactor WebSocket errors (API Change):

fix #949

* New error codes are introduced for WebSocket failures

* More verbose messages for error codes

* Error codes are mapped to conditions for ease of testing

* error::failed and error::handshake_failed are deprecated (don't use)

Actions Required:

* Code which explicitly compares error_code values against the
  constant `websocket::error::handshake_failed` should compare
  against `websocket::condition::handshake_failed` instead.

* Code which explicitly compares error_code values against the
  constant `websocket::error::failed` should compare
  against `websocket::condition::protocol_violation` instead.
This commit is contained in:
Vinnie Falco
2018-01-12 07:35:26 -08:00
parent 08a9ed4c25
commit cc43b46c42
19 changed files with 705 additions and 346 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ public:
[&](error_code ec, std::size_t)
{
++count;
if(ec != error::failed)
if(ec != error::bad_control_fragment)
BOOST_THROW_EXCEPTION(
system_error{ec});
});