errors.hpp (a2056e9ca86e767a774d621c5117939562c5aa54) errors.hpp (444b5ea4847ea7c014114094d4b63672122f9786)
1// Copyright 2021 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//

--- 18 unchanged lines hidden (view full) ---

27 * IPMI return code to use for the error.
28 */
29class IpmiException : public std::exception
30{
31 public:
32 explicit IpmiException(int ipmicc) :
33 _message("IPMI Code Received: " + std::to_string(ipmicc)),
34 _ipmicc(ipmicc)
1// Copyright 2021 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//

--- 18 unchanged lines hidden (view full) ---

27 * IPMI return code to use for the error.
28 */
29class IpmiException : public std::exception
30{
31 public:
32 explicit IpmiException(int ipmicc) :
33 _message("IPMI Code Received: " + std::to_string(ipmicc)),
34 _ipmicc(ipmicc)
35 {
36 }
35 {}
37
38 virtual const char* what() const noexcept override
39 {
40 return _message.c_str();
41 }
42
43 int getIpmiError() const
44 {
45 return _ipmicc;
46 }
47
48 private:
49 std::string _message;
50 int _ipmicc;
51};
52
53} // namespace ipmi
54} // namespace google
36
37 virtual const char* what() const noexcept override
38 {
39 return _message.c_str();
40 }
41
42 int getIpmiError() const
43 {
44 return _ipmicc;
45 }
46
47 private:
48 std::string _message;
49 int _ipmicc;
50};
51
52} // namespace ipmi
53} // namespace google