xref: /openbmc/telemetry/src/errors.hpp (revision 89cf7d7dafe2c073d781a40d59fa9c46cb344be6)
1 #pragma once
2 
3 #include <sdbusplus/exception.hpp>
4 
5 #include <string>
6 #include <string_view>
7 
8 namespace errors
9 {
10 
11 class InvalidArgument final : public sdbusplus::exception::internal_exception
12 {
13   public:
14     explicit InvalidArgument(std::string_view propertyName);
15     InvalidArgument(std::string_view propertyName, std::string_view info);
16 
17     const char* name() const noexcept override;
18     const char* description() const noexcept override;
19     const char* what() const noexcept override;
20     int get_errno() const noexcept override;
21 
22     std::string propertyName;
23 
24   private:
25     std::string errWhatDetailed;
26 };
27 
28 } // namespace errors
29