blob: 994f837823e8748d51ca12907ce8883fd171e5b0 [file] [log] [blame]
Patrick Venture035bbbb2018-12-12 14:59:52 -08001#pragma once
2
3#include <exception>
4#include <sstream>
5#include <string>
6
Patrick Venture9b534f02018-12-13 16:10:02 -08007namespace host_tool
8{
9
Patrick Venture035bbbb2018-12-12 14:59:52 -080010class IpmiException : public std::exception
11{
12 public:
13 explicit IpmiException(int cc)
14 {
15 std::ostringstream smessage;
16 smessage << "Received IPMI_CC: " << cc;
17 message = smessage.str();
18 }
19
20 virtual const char* what() const noexcept override
21 {
22 return message.c_str();
23 }
24
25 private:
26 std::string message;
27};
Patrick Venture9b534f02018-12-13 16:10:02 -080028
29} // namespace host_tool