xref: /openbmc/phosphor-host-ipmid/error-HostEvent.hpp (revision 6856f1b0b87aa00b2af811f02bdb7e7c51e41ca1)
1448e74e8STom Joseph #pragma once
2448e74e8STom Joseph 
3448e74e8STom Joseph #include <sdbusplus/exception.hpp>
4448e74e8STom Joseph 
5*6856f1b0SPatrick Williams #include <cerrno>
6448e74e8STom Joseph 
7*6856f1b0SPatrick Williams namespace sdbusplus::error::org::open_power::host
8*6856f1b0SPatrick Williams {
9b3f74aceSPatrick Williams struct Event final : public sdbusplus::exception::generated_exception
10448e74e8STom Joseph {
11b0b395b6SMarri Devender Rao     static constexpr auto errName = "org.open_power.Host.Error.Event";
120b02be92SPatrick Venture     static constexpr auto errDesc = "A host system event was received";
13448e74e8STom Joseph     static constexpr auto errWhat =
14b0b395b6SMarri Devender Rao         "org.open_power.Host.Error.Event: A host system event was received";
15448e74e8STom Joseph 
namesdbusplus::error::org::open_power::host::Event16*6856f1b0SPatrick Williams     const char* name() const noexcept override
17*6856f1b0SPatrick Williams     {
18*6856f1b0SPatrick Williams         return errName;
19*6856f1b0SPatrick Williams     }
descriptionsdbusplus::error::org::open_power::host::Event20*6856f1b0SPatrick Williams     const char* description() const noexcept override
21*6856f1b0SPatrick Williams     {
22*6856f1b0SPatrick Williams         return errDesc;
23*6856f1b0SPatrick Williams     }
whatsdbusplus::error::org::open_power::host::Event24*6856f1b0SPatrick Williams     const char* what() const noexcept override
25*6856f1b0SPatrick Williams     {
26*6856f1b0SPatrick Williams         return errWhat;
27*6856f1b0SPatrick Williams     }
28448e74e8STom Joseph };
29fbc6c9d7SPatrick Williams struct MaintenanceProcedure final :
30fbc6c9d7SPatrick Williams     public sdbusplus::exception::generated_exception
31b647d5beSTom Joseph {
320b02be92SPatrick Venture     static constexpr auto errName =
330b02be92SPatrick Venture         "org.open_power.Host.Error.MaintenanceProcedure";
34b647d5beSTom Joseph     static constexpr auto errDesc =
35b647d5beSTom Joseph         "A host system event with a procedure callout";
36b647d5beSTom Joseph     static constexpr auto errWhat =
37*6856f1b0SPatrick Williams         "org.open_power.Host.Error.MaintenanceProcedure: A host system event with a procedure callout";
38b647d5beSTom Joseph 
namesdbusplus::error::org::open_power::host::MaintenanceProcedure39*6856f1b0SPatrick Williams     const char* name() const noexcept override
40*6856f1b0SPatrick Williams     {
41*6856f1b0SPatrick Williams         return errName;
42*6856f1b0SPatrick Williams     }
descriptionsdbusplus::error::org::open_power::host::MaintenanceProcedure43*6856f1b0SPatrick Williams     const char* description() const noexcept override
44*6856f1b0SPatrick Williams     {
45*6856f1b0SPatrick Williams         return errDesc;
46*6856f1b0SPatrick Williams     }
whatsdbusplus::error::org::open_power::host::MaintenanceProcedure47*6856f1b0SPatrick Williams     const char* what() const noexcept override
48*6856f1b0SPatrick Williams     {
49*6856f1b0SPatrick Williams         return errWhat;
50*6856f1b0SPatrick Williams     }
51b647d5beSTom Joseph };
52*6856f1b0SPatrick Williams } // namespace sdbusplus::error::org::open_power::host
53b647d5beSTom Joseph 
54*6856f1b0SPatrick Williams #ifndef SDBUSPP_REMOVE_DEPRECATED_NAMESPACE
55*6856f1b0SPatrick Williams namespace sdbusplus::org::open_power::Host::Error
56*6856f1b0SPatrick Williams {
57*6856f1b0SPatrick Williams using Event = sdbusplus::error::org::open_power::host::Event;
58*6856f1b0SPatrick Williams using MaintenanceProcedure =
59*6856f1b0SPatrick Williams     sdbusplus::error::org::open_power::host::MaintenanceProcedure;
60*6856f1b0SPatrick Williams } // namespace sdbusplus::org::open_power::Host::Error
61*6856f1b0SPatrick Williams #endif
62