mpd/src/lib/dbus/Error.cxx
2023-03-06 14:59:48 +01:00

20 lines
368 B
C++

// SPDX-License-Identifier: BSD-2-Clause
// Copyright CM4all GmbH
// author: Max Kellermann <mk@cm4all.com>
#include "Error.hxx"
#include "lib/fmt/RuntimeError.hxx"
void
ODBus::Error::Throw(const char *prefix) const
{
throw FmtRuntimeError("{}: {}", prefix, GetMessage());
}
void
ODBus::Error::CheckThrow(const char *prefix) const
{
if (*this)
Throw(prefix);
}