Vernon Mauery | a3702c1 | 2019-05-22 13:20:59 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/exception.hpp> |
| 4 | |
| 5 | namespace sdbusplus |
| 6 | { |
| 7 | namespace xyz |
| 8 | { |
| 9 | namespace openbmc_project |
| 10 | { |
| 11 | namespace Common |
| 12 | { |
| 13 | namespace Error |
| 14 | { |
| 15 | |
| 16 | struct Timeout final : public sdbusplus::exception_t |
| 17 | { |
| 18 | static constexpr auto errName = "xyz.openbmc_project.Common.Error.Timeout"; |
| 19 | static constexpr auto errDesc = "Operation timed out."; |
| 20 | static constexpr auto errWhat = |
| 21 | "xyz.openbmc_project.Common.Error.Timeout: Operation timed out."; |
| 22 | |
| 23 | const char* name() const noexcept override; |
| 24 | const char* description() const noexcept override; |
| 25 | const char* what() const noexcept override; |
| 26 | }; |
| 27 | |
| 28 | struct InternalFailure final : public sdbusplus::exception_t |
| 29 | { |
| 30 | static constexpr auto errName = |
| 31 | "xyz.openbmc_project.Common.Error.InternalFailure"; |
| 32 | static constexpr auto errDesc = "The operation failed internally."; |
| 33 | static constexpr auto errWhat = |
| 34 | "xyz.openbmc_project.Common.Error.InternalFailure: The operation " |
| 35 | "failed internally."; |
| 36 | |
| 37 | const char* name() const noexcept override; |
| 38 | const char* description() const noexcept override; |
| 39 | const char* what() const noexcept override; |
| 40 | }; |
| 41 | |
| 42 | struct InvalidArgument final : public sdbusplus::exception_t |
| 43 | { |
| 44 | static constexpr auto errName = |
| 45 | "xyz.openbmc_project.Common.Error.InvalidArgument"; |
| 46 | static constexpr auto errDesc = "Invalid argument was given."; |
| 47 | static constexpr auto errWhat = |
| 48 | "xyz.openbmc_project.Common.Error.InvalidArgument: Invalid argument " |
| 49 | "was given."; |
| 50 | |
| 51 | const char* name() const noexcept override; |
| 52 | const char* description() const noexcept override; |
| 53 | const char* what() const noexcept override; |
| 54 | }; |
| 55 | |
| 56 | struct InsufficientPermission final : public sdbusplus::exception_t |
| 57 | { |
| 58 | static constexpr auto errName = |
| 59 | "xyz.openbmc_project.Common.Error.InsufficientPermission"; |
| 60 | static constexpr auto errDesc = |
| 61 | "Insufficient permission to perform operation"; |
| 62 | static constexpr auto errWhat = |
| 63 | "xyz.openbmc_project.Common.Error.InsufficientPermission: Insufficient " |
| 64 | "permission to perform operation"; |
| 65 | |
| 66 | const char* name() const noexcept override; |
| 67 | const char* description() const noexcept override; |
| 68 | const char* what() const noexcept override; |
| 69 | }; |
| 70 | |
| 71 | } // namespace Error |
| 72 | } // namespace Common |
| 73 | } // namespace openbmc_project |
| 74 | } // namespace xyz |
| 75 | } // namespace sdbusplus |