summaryrefslogtreecommitdiff
path: root/redfish-core/include/utils/dbus_utils.hpp
blob: 298a56b6ec38ca44de4c2a30ea34dc92f7958ccc (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
#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: {}, reason: {}", property,
            static_cast<std::underlying_type_t<sdbusplus::UnpackErrorReason>>(
                reason));
    }
};

} // namespace dbus_utils
} // namespace redfish