WorkflowExecutionException.h
1 
11 #ifndef WRENCH_EXCEPTION_H
12 #define WRENCH_EXCEPTION_H
13 
14 #include <exception>
15 #include <memory>
16 #include <string>
17 #include <string.h>
18 
19 #include "wrench/workflow/failure_causes/FailureCause.h"
20 
21 namespace wrench {
22 
23  /***********************/
25  /***********************/
26 
32  class WorkflowExecutionException: public std::exception {
33 
34  private:
35  std::shared_ptr<FailureCause> cause;
36 
37  public:
38 
43  virtual const char* what() const throw()
44  {
45  // Without the strdup() below, we get some valgrind warnings...
46  return strdup(cause->toString().c_str());
47  }
48 
53  std::shared_ptr<FailureCause> getCause() {
54  return this->cause;
55  }
56 
57 
58  /***********************/
60  /***********************/
61 
66  WorkflowExecutionException(std::shared_ptr<FailureCause> cause) {
67  this->cause = cause;
68  }
69 
70  /***********************/
72  /***********************/
73  };
74 
75 
76  /***********************/
78  /***********************/
79 
80 
81 }
82 
83 
84 #endif //WRENCH_EXCEPTION_H
Definition: Alarm.cpp:20
An generic exception that is thrown whenever something unexpected (but simulation-valid) occurs durin...
Definition: WorkflowExecutionException.h:32
WorkflowExecutionException(std::shared_ptr< FailureCause > cause)
Constructor.
Definition: WorkflowExecutionException.h:66
virtual const char * what() const
Get the exception's error message.
Definition: WorkflowExecutionException.h:43
std::shared_ptr< FailureCause > getCause()
Get the failure cause.
Definition: WorkflowExecutionException.h:53