summaryrefslogtreecommitdiff
path: root/redfish-core/include/utils/dbus_utils.hpp
blob: 7e895fea474ec10d999a601a1b3e87fbb94038a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "logging.hpp"

#include <sdbusplus/unpack_properties.hpp>

namespace redfish
{
namespace dbus_utils
{

struct UnpackErrorPrinter
{
    void operator()(const sdbusplus::UnpackErrorReason reason,
                    const std::string& property) const noexcept
    {
        BMCWEB_LOG_ERROR
            << "DBUS property error in property: " << property << ", reason: "
            << static_cast<
                   std::underlying_type_t<sdbusplus::UnpackErrorReason>>(
                   reason);
    }
};

} // namespace dbus_utils
} // namespace redfish