Flow 1.0.0
Flow project: Public API.
|
Namespace containing the net_flow module's extension of boost.system error conventions, so that Flow network protocol API can return codes/messages from within its own new set of error codes/messages. More...
Functions | |
Error_code | make_error_code (Code err_code) |
Given a Code enum value, creates a lightweight flow::Error_code (a/k/a boost.system error_code ) representing that error. More... | |
Namespace containing the net_flow module's extension of boost.system error conventions, so that Flow network protocol API can return codes/messages from within its own new set of error codes/messages.
The contents of this namespace
is one instance (and model example) for how one can easily create their own simple error code set enum
(and corresponding string messages) and hook it into the flexible, yet maximally fast, boost.system error facility. Another example (a peer of ours) would be boost.asio's error code set. See flow::Error_code doc header for a top-down summary of the Flow-used-and-recommended error reporting system.
For boost.system experts wondering whether there is support for error_condition
equivalence (i.e., the ability to compare a given flow::error::error_code
to a more general boost::system::error_condition
), currently the answer is no, there isn't. We may add error_condition
s as Error_code usage patterns emerge over time.
|
strong |
All possible errors returned (via flow::Error_code arguments) by flow::net_flow functions/methods.
These values are convertible to flow::Error_code (a/k/a boost::system::error_code
) and thus extend the set of errors that flow::Error_code can represent.
Enumerator | |
---|---|
S_NODE_NOT_RUNNING | Node not running. |
S_CANNOT_CONNECT_TO_IP_ANY | Cannot ask to connect to "any" IP address. Use specific IP address. |
S_INVALID_SERVICE_PORT_NUMBER | Flow port number is not in the valid service port number range. |
S_PORT_TAKEN | Flow port already reserved. |
S_INTERNAL_ERROR_PORT_NOT_TAKEN | Internal error: Tried to return Flow port which had not been reserved. |
S_OUT_OF_PORTS | No more ephemeral Flow ports available. |
S_INTERNAL_ERROR_PORT_COLLISION | Internal error: Ephemeral port double reservation allowed. |
S_CONN_RESET_BAD_PEER_BEHAVIOR | Connection reset because of unexpected/illegal behavior by the other side. |
S_CONN_REFUSED | Other side refused connection. |
S_INTERNAL_ERROR_SYSTEM_ERROR_ASIO_TIMER | Internal error: System error: Something went wrong with boost.asio timer subsystem. |
S_CONN_TIMEOUT | Other side did not complete connection handshake within the allowed time; perhaps no one is listening. |
S_CONN_RESET_BY_OTHER_SIDE | Other side reset an established connection. |
S_CONN_RESET_TOO_MANY_REXMITS | Connection reset because a packet has been retransmitted too many times. |
S_SEQ_NUM_ARITHMETIC_FAILURE | Other side has sent packets with inconsistent sequence numbers. |
S_SEQ_NUM_IMPLIES_CONNECTION_COLLISION | Other side has sent packet with sequence number that implies a port collision between two connections over time. |
S_NODE_SHUTTING_DOWN | Node shutting down. |
S_USER_CLOSED_ABRUPTLY | User code on this side abruptly closed connection; other side may be informed of this. |
S_EVENT_SET_CLOSED | Attempted operation on an event set, when that event set was closed. |
S_EVENT_SET_IMMUTABLE_WHEN_WAITING | Attempted to write to an event set, while a wait operation was pending on that event set. |
S_EVENT_SET_EVENT_ALREADY_EXISTS | Attempted to add an event into an event set, but that event already exists. |
S_EVENT_SET_EVENT_DOES_NOT_EXIST | Attempted to work with an event that does not exist in the event set. |
S_EVENT_SET_DOUBLE_WAIT_OR_POLL | Attempted to wait on or poll an event set while already waiting on that event set. |
S_EVENT_SET_NO_EVENTS | Attempted to wait on an event set without specifying event on which to wait. |
S_EVENT_SET_RESULT_CHECK_WHEN_WAITING | Attempted to check wait results while still waiting. |
S_CONN_METADATA_TOO_LARGE | During connection user supplied metadata that is too large. |
S_STATIC_OPTION_CHANGED | When setting options, tried to set an unchangeable (static) option. |
S_OPTION_CHECK_FAILED | When setting options, at least one option's value violates a required condition on that option. |
S_WAIT_INTERRUPTED | A blocking ( |
S_WAIT_USER_TIMEOUT | A blocking ( |
Error_code flow::net_flow::error::make_error_code | ( | Code | err_code | ) |
Given a Code
enum
value, creates a lightweight flow::Error_code (a/k/a boost.system error_code
) representing that error.
This is needed to make the boost::system::error_code::error_code<Code>()
template implementation work. Or, slightly more in English, it glues the (completely general) flow::Error_code to the (net_flow-specific) error code set flow::net_flow::error::Code, so that one can implicitly covert from the latter to the former.
err_code | The enum value. |