Patrick Venture | 035bbbb | 2018-12-12 14:59:52 -0800 | [diff] [blame] | 1 | #pragma once |
2 | |||||
3 | #include <exception> | ||||
4 | #include <sstream> | ||||
5 | #include <string> | ||||
6 | |||||
7 | class IpmiException : public std::exception | ||||
8 | { | ||||
9 | public: | ||||
10 | explicit IpmiException(int cc) | ||||
11 | { | ||||
12 | std::ostringstream smessage; | ||||
13 | smessage << "Received IPMI_CC: " << cc; | ||||
14 | message = smessage.str(); | ||||
15 | } | ||||
16 | |||||
17 | virtual const char* what() const noexcept override | ||||
18 | { | ||||
19 | return message.c_str(); | ||||
20 | } | ||||
21 | |||||
22 | private: | ||||
23 | std::string message; | ||||
24 | }; |