recovery_exception.h
Go to the documentation of this file.
1 #ifndef MBF_UTILITY__RECOVERY_EXCEPTION_H_
2 #define MBF_UTILITY__RECOVERY_EXCEPTION_H_
3 
4 #include <exception>
5 #include <mbf_msgs/RecoveryResult.h>
6 
7 namespace mbf_utility
8 {
9 
10 struct RecoveryException : public std::exception
11 {
12  RecoveryException(unsigned int error_code) : outcome(error_code){}
13 
14  const char * what () const throw () {
15  switch(outcome)
16  {
17  case mbf_msgs::RecoveryResult::FAILURE: return "Failure";
18  case mbf_msgs::RecoveryResult::CANCELED: return "Canceled";
19  case mbf_msgs::RecoveryResult::PAT_EXCEEDED: return "Patience exceeded";
20  case mbf_msgs::RecoveryResult::TF_ERROR: return "TF Error";
21  case mbf_msgs::RecoveryResult::NOT_INITIALIZED: return "Not initialized";
22  case mbf_msgs::RecoveryResult::INVALID_PLUGIN: return "Invalid Plugin";
23  case mbf_msgs::RecoveryResult::INTERNAL_ERROR: return "Internal Error";
24  case mbf_msgs::RecoveryResult::STOPPED: return "Stopped";
25  default: return "unknown error code: " + outcome;
26  }
27  }
28  unsigned int outcome;
29 };
30 
31 } /* namespace mbf_utility */
32 
33 #endif // MBF_UTILITY__RECOVERY_EXCEPTION_H_
RecoveryException(unsigned int error_code)


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