wrench::NetworkError

class NetworkError : public wrench::FailureCause

A “network error (or endpoint is down)” failure cause.

Public Types

enum ErrorType

Enumerated type to describe the type of the network error.

Values:

enumerator TIMEOUT
enumerator FAILURE
enum OperationType

Enumerated type to describe whether the network error occured while sending or receiving.

Values:

enumerator SENDING
enumerator RECEIVING

Public Functions

NetworkError(NetworkError::OperationType, NetworkError::ErrorType, const std::string &commport_name, const std::string &message_name)

Constructor.

Parameters:
  • operation_type – NetworkError:OperationType::SENDING or NetworkError::OperationType::RECEIVING or NetworkError::OperationType::UNKNOWN

  • error_type – the error type

  • commport_name – the name of a commport (or “” if unknown)

  • message_name – the name of the message (or “” if unknown)

std::string getCommPortName()

Returns the name of the CommPort on which the error occurred.

Returns:

the commport name

bool isTimeout()

Returns whether the network error was a timeout.

Returns:

true or false

virtual std::string toString() override

Get the human-readable failure message.

Returns:

the message

bool whileReceiving()

Returns whether the network error occurred while receiving.

Returns:

true or false

bool whileSending()

Returns whether the network error occurred while sending.

Returns:

true or false