NetworkError.h
1 
10 #ifndef WRENCH_NETWORK_ERROR_H
11 #define WRENCH_NETWORK_ERROR_H
12 
13 #include <set>
14 #include <string>
15 
16 #include "wrench/workflow/failure_causes/FailureCause.h"
17 
18 namespace wrench {
19 
20 
21  /***********************/
23  /***********************/
24 
28  class NetworkError : public FailureCause {
29  public:
34  SENDING,
35  RECEIVING
36  };
37 
40  enum ErrorType {
41  TIMEOUT,
42  FAILURE
43  };
44 
45  /***********************/
47  /***********************/
49  /***********************/
51  /***********************/
52 
53  std::string toString();
54  bool whileReceiving();
55  bool whileSending();
56  bool isTimeout();
57  std::string getMailbox();
58 
59  private:
60  NetworkError::OperationType operation_type;
61  NetworkError::ErrorType error_type;
62  bool while_sending = false;
63  std::string mailbox = "";
64  };
65 
66 
67  /***********************/
69  /***********************/
70 };
71 
72 
73 #endif //WRENCH_NETWORK_ERROR_H
OperationType
Enumerated type to describe whether the network error occured while sending or receiving.
Definition: NetworkError.h:33
NetworkError(NetworkError::OperationType, NetworkError::ErrorType, std::string mailbox)
Constructor.
Definition: NetworkError.cpp:31
std::string getMailbox()
Returns the mailbox name on which the error occurred.
Definition: NetworkError.cpp:70
A "network error (or endpoint is down)" failure cause.
Definition: NetworkError.h:28
Definition: Alarm.cpp:20
A top-level class to describe all simulation-valid failures that can occur during workflow execution ...
Definition: FailureCause.h:31
ErrorType
Enumerated type to describe the type of the network error.
Definition: NetworkError.h:40
bool isTimeout()
Returns whether the network error was a timeout.
Definition: NetworkError.cpp:62
std::string toString()
Get the human-readable failure message.
Definition: NetworkError.cpp:78
bool whileSending()
Returns whether the network error occurred while sending.
Definition: NetworkError.cpp:54
bool whileReceiving()
Returns whether the network error occurred while receiving.
Definition: NetworkError.cpp:46