get_path_exception.h
Go to the documentation of this file.
1 #ifndef MBF_UTILITY__GET_PATH_EXCEPTION_H_
2 #define MBF_UTILITY__GET_PATH_EXCEPTION_H_
3 
4 #include <exception>
5 #include <mbf_msgs/GetPathResult.h>
6 
7 namespace mbf_utility
8 {
9 
10 struct GetPathException : public std::exception
11 {
12  GetPathException(unsigned int error_code) : outcome(error_code){}
13 
14  const char * what () const throw () {
15  switch(outcome)
16  {
17  case mbf_msgs::GetPathResult::FAILURE: return "Failure";
18  case mbf_msgs::GetPathResult::CANCELED: return "Canceled";
19  case mbf_msgs::GetPathResult::INVALID_START: return "Invalid start"
20  case mbf_msgs::GetPathResult::INVALID_GOAL: return "Invalid goal"
21  case mbf_msgs::GetPathResult::NO_PATH_FOUND: return "No path found";
22  case mbf_msgs::GetPathResult::PAT_EXCEEDED: return "Patience exceeded";
23  case mbf_msgs::GetPathResult::EMPTY_PATH return "Empty Path";
24  case mbf_msgs::GetPathResult::TF_ERROR: return "TF Error";
25  case mbf_msgs::GetPathResult::NOT_INITIALIZED: return "Not initialized";
26  case mbf_msgs::GetPathResult::INVALID_PLUGIN: return "Invalid Plugin";
27  case mbf_msgs::GetPathResult::INTERNAL_ERROR: return "Internal Error";
28  case mbf_msgs::GetPathResult::STOPPED: return "Stopped";
29  case mbf_msgs::GetPathResult::OUT_OF_MAP: return "Out of map";
30  case mbf_msgs::GetPathResult::MAP_ERROR: return "Map error";
31  default: return "unknown error code: " + outcome;
32  }
33  }
34  unsigned int outcome;
35 };
36 
37 } /* namespace mbf_utility */
38 
39 #endif // MBF_UTILITY__GET_PATH_EXCEPTION_H_
mbf_utility::GetPathException
Definition: get_path_exception.h:10
mbf_utility::GetPathException::GetPathException
GetPathException(unsigned int error_code)
Definition: get_path_exception.h:12
mbf_utility::GetPathException::outcome
unsigned int outcome
Definition: get_path_exception.h:34
mbf_utility
Definition: exe_path_exception.h:7
mbf_utility::GetPathException::what
const char * what() const
Definition: get_path_exception.h:14


mbf_utility
Author(s): Sebastian Pütz
autogenerated on Wed Mar 2 2022 00:33:44