Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::processor::error Namespace Reference

Error code category and codes used by all processor types.

Classes

class  processor_category
 Category for processor errors. More...
 

Enumerations

enum  processor_errors {
  general = 1 , bad_request , protocol_violation , message_too_big ,
  invalid_payload , invalid_arguments , invalid_opcode , control_too_big ,
  invalid_rsv_bit , fragmented_control , invalid_continuation , masking_required ,
  masking_forbidden , non_minimal_encoding , requires_64bit , invalid_utf8 ,
  not_implemented , invalid_http_method , invalid_http_version , invalid_http_status ,
  missing_required_header , sha1_library , no_protocol_support , reserved_close_code ,
  invalid_close_code , reason_requires_code , subprotocol_parse_error , extension_parse_error ,
  extensions_disabled , short_key3
}
 

Functions

lib::error_category const & get_processor_category ()
 Get a reference to a static copy of the processor error category.
 
lib::error_code make_error_code (error::processor_errors e)
 Create an error code with the given value and the processor category.
 
close::status::value to_ws (lib::error_code ec)
 Converts a processor error_code into a websocket close code.
 

Enumeration Type Documentation

◆ processor_errors

Enumerator
general 

Catch-all error for processor policy errors that don't fit in other categories

bad_request 

Error was the result of improperly formatted user input.

protocol_violation 

Processor encountered a protocol violation in an incoming message.

message_too_big 

Processor encountered a message that was too large.

invalid_payload 

Processor encountered invalid payload data.

invalid_arguments 

The processor method was called with invalid arguments.

invalid_opcode 

Opcode was invalid for requested operation.

control_too_big 

Control frame too large.

invalid_rsv_bit 

Illegal use of reserved bit.

fragmented_control 

Fragmented control message.

invalid_continuation 

Continuation without message.

masking_required 

Clients may not send unmasked frames.

masking_forbidden 

Servers may not send masked frames.

non_minimal_encoding 

Payload length not minimally encoded.

requires_64bit 

Not supported on 32 bit systems.

invalid_utf8 

Invalid UTF-8 encoding.

not_implemented 

Operation required not implemented functionality.

invalid_http_method 

Invalid HTTP method.

invalid_http_version 

Invalid HTTP version.

invalid_http_status 

Invalid HTTP status.

missing_required_header 

Missing Required Header.

sha1_library 

Embedded SHA-1 library error.

no_protocol_support 

No support for this feature in this protocol version.

reserved_close_code 

Reserved close code used.

invalid_close_code 

Invalid close code used.

reason_requires_code 

Using a reason requires a close code.

subprotocol_parse_error 

Error parsing subprotocols.

extension_parse_error 

Error parsing extensions.

extensions_disabled 

Extension related operation was ignored because extensions are disabled.

short_key3 

Short Ke3 read. Hybi00 requires a third key to be read from the 8 bytes after the handshake. Less than 8 bytes were read.

Definition at line 66 of file base.hpp.

66 {
69 general = 1,
70
72 bad_request,
73
76
79
82
85
88
91
94
97
100
103
106
109
112
114 invalid_utf8,
115
117 not_implemented,
118
121
124
127
130
133
136
138 reserved_close_code,
139
141 invalid_close_code,
142
145
148
151
154
158};
@ missing_required_header
Missing Required Header.
Definition base.hpp:129
@ control_too_big
Control frame too large.
Definition base.hpp:90
@ invalid_http_method
Invalid HTTP method.
Definition base.hpp:120
@ invalid_rsv_bit
Illegal use of reserved bit.
Definition base.hpp:93
@ reason_requires_code
Using a reason requires a close code.
Definition base.hpp:144
@ masking_required
Clients may not send unmasked frames.
Definition base.hpp:102
@ protocol_violation
Processor encountered a protocol violation in an incoming message.
Definition base.hpp:75
@ extensions_disabled
Extension related operation was ignored because extensions are disabled.
Definition base.hpp:153
@ extension_parse_error
Error parsing extensions.
Definition base.hpp:150
@ masking_forbidden
Servers may not send masked frames.
Definition base.hpp:105
@ invalid_opcode
Opcode was invalid for requested operation.
Definition base.hpp:87
@ sha1_library
Embedded SHA-1 library error.
Definition base.hpp:132
@ requires_64bit
Not supported on 32 bit systems.
Definition base.hpp:111
@ subprotocol_parse_error
Error parsing subprotocols.
Definition base.hpp:147
@ invalid_http_status
Invalid HTTP status.
Definition base.hpp:126
@ invalid_payload
Processor encountered invalid payload data.
Definition base.hpp:81
@ invalid_http_version
Invalid HTTP version.
Definition base.hpp:123
@ message_too_big
Processor encountered a message that was too large.
Definition base.hpp:78
@ no_protocol_support
No support for this feature in this protocol version.
Definition base.hpp:135
@ invalid_arguments
The processor method was called with invalid arguments.
Definition base.hpp:84
@ invalid_continuation
Continuation without message.
Definition base.hpp:99
@ non_minimal_encoding
Payload length not minimally encoded.
Definition base.hpp:108
@ fragmented_control
Fragmented control message.
Definition base.hpp:96

Function Documentation

◆ get_processor_category()

lib::error_category const & websocketpp::processor::error::get_processor_category ( )
inline

Definition at line 238 of file base.hpp.

238 {
239 static processor_category instance;
240 return instance;
241}
Category for processor errors.
Definition base.hpp:161
Here is the caller graph for this function:

◆ make_error_code()

lib::error_code websocketpp::processor::error::make_error_code ( error::processor_errors e)
inline

Definition at line 244 of file base.hpp.

244 {
245 return lib::error_code(static_cast<int>(e), get_processor_category());
246}
lib::error_category const & get_processor_category()
Get a reference to a static copy of the processor error category.
Definition base.hpp:238
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_ws()

close::status::value websocketpp::processor::error::to_ws ( lib::error_code ec)
inline

Looks up the appropriate WebSocket close code that should be sent after an error of this sort occurred.

If the error is not in the processor category close::status::blank is returned.

If the error isn't normally associated with reasons to close a connection (such as errors intended to be used internally or delivered to client applications, ex: invalid arguments) then close::status::internal_endpoint_error is returned.

Definition at line 261 of file base.hpp.

261 {
262 if (ec.category() != get_processor_category()) {
263 return close::status::blank;
264 }
265
266 switch (ec.value()) {
267 case error::protocol_violation:
268 case error::control_too_big:
269 case error::invalid_opcode:
270 case error::invalid_rsv_bit:
271 case error::fragmented_control:
272 case error::invalid_continuation:
273 case error::masking_required:
274 case error::masking_forbidden:
275 case error::reserved_close_code:
276 case error::invalid_close_code:
277 return close::status::protocol_error;
278 case error::invalid_payload:
279 case error::invalid_utf8:
280 return close::status::invalid_payload;
281 case error::message_too_big:
282 return close::status::message_too_big;
283 default:
284 return close::status::internal_endpoint_error;
285 }
286}
Here is the call graph for this function: