exe_path_exception.h
Go to the documentation of this file.
1 #ifndef MBF_UTILITY__EXE_PATH_EXCEPTION_H_
2 #define MBF_UTILITY__EXE_PATH_EXCEPTION_H_
3 
4 #include <exception>
5 #include <mbf_msgs/ExePathResult.h>
6 
7 namespace mbf_utility
8 {
9 
10 struct ExePathException : public std::exception
11 {
12  ExePathException(unsigned int error_code) : outcome(error_code){}
13 
14  const char * what () const throw () {
15  switch(outcome)
16  {
17  case mbf_msgs::ExePathResult::FAILURE: return "Failure";
18  case mbf_msgs::ExePathResult::CANCELED: return "Canceled";
19  case mbf_msgs::ExePathResult::NO_VALID_CMD: return "No valid command";
20  case mbf_msgs::ExePathResult::PAT_EXCEEDED: return "Patience exceeded";
21  case mbf_msgs::ExePathResult::COLLISION: return "Collision";
22  case mbf_msgs::ExePathResult::OSCILLATION: return "Oscillation";
23  case mbf_msgs::ExePathResult::ROBOT_STUCK: return "Robot stuck";
24  case mbf_msgs::ExePathResult::MISSED_GOAL: return "Missed Goal";
25  case mbf_msgs::ExePathResult::MISSED_PATH: return "Missed Path";
26  case mbf_msgs::ExePathResult::BLOCKED_PATH: return "Blocked Path";
27  case mbf_msgs::ExePathResult::INVALID_PATH: return "Invalid Path";
28  case mbf_msgs::ExePathResult::TF_ERROR: return "TF Error";
29  case mbf_msgs::ExePathResult::NOT_INITIALIZED: return "Not initialized";
30  case mbf_msgs::ExePathResult::INVALID_PLUGIN: return "Invalid Plugin";
31  case mbf_msgs::ExePathResult::INTERNAL_ERROR: return "Internal Error";
32  case mbf_msgs::ExePathResult::STOPPED: return "Stopped";
33  case mbf_msgs::ExePathResult::OUT_OF_MAP: return "Out of map";
34  case mbf_msgs::ExePathResult::MAP_ERROR: return "Map error";
35  default: return "unknown error code: " + outcome;
36  }
37  }
38  unsigned int outcome;
39 };
40 
41 } /* namespace mbf_utility */
42 
43 #endif // MBF_UTILITY__EXE_PATH_EXCEPTION_H_
ExePathException(unsigned int error_code)


mbf_utility
Author(s): Sebastian Pütz
autogenerated on Mon Feb 28 2022 22:49:48