blob: 9e6397ab89e22c0b90f434c28d28aeee4e7bb271 [file] [log] [blame]
Tom Joseph448e74e2017-07-24 23:08:56 +05301#pragma once
2
3#include <sdbusplus/exception.hpp>
4
Patrick Williams6856f1b2023-09-01 16:10:07 -05005#include <cerrno>
Tom Joseph448e74e2017-07-24 23:08:56 +05306
Patrick Williams6856f1b2023-09-01 16:10:07 -05007namespace sdbusplus::error::org::open_power::host
8{
Patrick Williamsb3f74ac2021-09-09 06:45:37 -05009struct Event final : public sdbusplus::exception::generated_exception
Tom Joseph448e74e2017-07-24 23:08:56 +053010{
Marri Devender Raob0b395b2017-10-24 10:14:14 -050011 static constexpr auto errName = "org.open_power.Host.Error.Event";
Patrick Venture0b02be92018-08-31 11:55:55 -070012 static constexpr auto errDesc = "A host system event was received";
Tom Joseph448e74e2017-07-24 23:08:56 +053013 static constexpr auto errWhat =
Patrick Venture0b02be92018-08-31 11:55:55 -070014 "org.open_power.Host.Error.Event: A host system event was received";
Tom Joseph448e74e2017-07-24 23:08:56 +053015
Patrick Williams6856f1b2023-09-01 16:10:07 -050016 const char* name() const noexcept override
17 {
18 return errName;
19 }
20 const char* description() const noexcept override
21 {
22 return errDesc;
23 }
24 const char* what() const noexcept override
25 {
26 return errWhat;
27 }
Tom Joseph448e74e2017-07-24 23:08:56 +053028};
Patrick Williamsfbc6c9d2023-05-10 07:50:16 -050029struct MaintenanceProcedure final :
30 public sdbusplus::exception::generated_exception
Tom Josephb647d5b2017-10-31 17:25:33 +053031{
Patrick Venture0b02be92018-08-31 11:55:55 -070032 static constexpr auto errName =
33 "org.open_power.Host.Error.MaintenanceProcedure";
Tom Josephb647d5b2017-10-31 17:25:33 +053034 static constexpr auto errDesc =
Patrick Venture0b02be92018-08-31 11:55:55 -070035 "A host system event with a procedure callout";
Tom Josephb647d5b2017-10-31 17:25:33 +053036 static constexpr auto errWhat =
Patrick Williams6856f1b2023-09-01 16:10:07 -050037 "org.open_power.Host.Error.MaintenanceProcedure: A host system event with a procedure callout";
Tom Josephb647d5b2017-10-31 17:25:33 +053038
Patrick Williams6856f1b2023-09-01 16:10:07 -050039 const char* name() const noexcept override
40 {
41 return errName;
42 }
43 const char* description() const noexcept override
44 {
45 return errDesc;
46 }
47 const char* what() const noexcept override
48 {
49 return errWhat;
50 }
Tom Josephb647d5b2017-10-31 17:25:33 +053051};
Patrick Williams6856f1b2023-09-01 16:10:07 -050052} // namespace sdbusplus::error::org::open_power::host
Tom Josephb647d5b2017-10-31 17:25:33 +053053
Patrick Williams6856f1b2023-09-01 16:10:07 -050054#ifndef SDBUSPP_REMOVE_DEPRECATED_NAMESPACE
55namespace sdbusplus::org::open_power::Host::Error
56{
57using Event = sdbusplus::error::org::open_power::host::Event;
58using MaintenanceProcedure =
59 sdbusplus::error::org::open_power::host::MaintenanceProcedure;
60} // namespace sdbusplus::org::open_power::Host::Error
61#endif