Patrick Venture | c404b3e | 2018-10-30 14:17:49 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <exception> |
| 4 | #include <string> |
| 5 | |
| 6 | class SensorBuildException : public std::exception |
| 7 | { |
| 8 | public: |
Patrick Venture | 83a2c3b | 2020-08-03 11:19:28 -0700 | [diff] [blame] | 9 | explicit SensorBuildException(const std::string& message) : message(message) |
Patrick Venture | a83a3ec | 2020-08-04 09:52:05 -0700 | [diff] [blame] | 10 | {} |
Patrick Venture | c404b3e | 2018-10-30 14:17:49 -0700 | [diff] [blame] | 11 | |
| 12 | virtual const char* what() const noexcept override |
| 13 | { |
| 14 | return message.c_str(); |
| 15 | } |
| 16 | |
| 17 | private: |
| 18 | std::string message; |
| 19 | }; |
James Feist | 734f953 | 2018-11-15 12:13:18 -0800 | [diff] [blame] | 20 | |
| 21 | class ControllerBuildException : public std::exception |
| 22 | { |
| 23 | public: |
Patrick Venture | 83a2c3b | 2020-08-03 11:19:28 -0700 | [diff] [blame] | 24 | explicit ControllerBuildException(const std::string& message) : |
| 25 | message(message) |
Patrick Venture | a83a3ec | 2020-08-04 09:52:05 -0700 | [diff] [blame] | 26 | {} |
James Feist | 734f953 | 2018-11-15 12:13:18 -0800 | [diff] [blame] | 27 | |
| 28 | virtual const char* what() const noexcept override |
| 29 | { |
| 30 | return message.c_str(); |
| 31 | } |
| 32 | |
| 33 | private: |
| 34 | std::string message; |
| 35 | }; |
Patrick Venture | 81cef91 | 2019-02-11 11:57:25 -0800 | [diff] [blame] | 36 | |
| 37 | class ConfigurationException : public std::exception |
| 38 | { |
| 39 | public: |
Patrick Venture | 83a2c3b | 2020-08-03 11:19:28 -0700 | [diff] [blame] | 40 | explicit ConfigurationException(const std::string& message) : |
| 41 | message(message) |
Patrick Venture | a83a3ec | 2020-08-04 09:52:05 -0700 | [diff] [blame] | 42 | {} |
Patrick Venture | 81cef91 | 2019-02-11 11:57:25 -0800 | [diff] [blame] | 43 | |
| 44 | virtual const char* what() const noexcept override |
| 45 | { |
| 46 | return message.c_str(); |
| 47 | } |
| 48 | |
| 49 | private: |
| 50 | std::string message; |
| 51 | }; |