imu_advanced_navigation_anpp
Exceptions.hpp
Go to the documentation of this file.
1 #ifndef ADVANCED_NAVIGATION_ANPP_EXCEPTIONS_HPP
2 #define ADVANCED_NAVIGATION_ANPP_EXCEPTIONS_HPP
3 
4 #include <stdexcept>
5 
7 {
10  {
18  };
19 
20  struct AcknowledgeFailure : public std::runtime_error
21  {
22  uint8_t const packet_id;
24 
25  static std::string resultToString(ACK_RESULTS);
26 
27  AcknowledgeFailure(uint8_t packet_id, ACK_RESULTS result)
28  : std::runtime_error("received failure after having sent a configuration change: " + resultToString(result))
29  , packet_id(packet_id)
30  , result(result) {}
31  };
32 }
33 
34 #endif
35 
Definition: Exceptions.hpp:11
ACK_RESULTS
Definition: Exceptions.hpp:9
ACK_RESULTS const result
Definition: Exceptions.hpp:23
uint8_t const packet_id
Definition: Exceptions.hpp:22
static std::string resultToString(ACK_RESULTS)
Definition: Exceptions.cpp:8
AcknowledgeFailure(uint8_t packet_id, ACK_RESULTS result)
Definition: Exceptions.hpp:27
Definition: Configuration.hpp:8