27 #ifndef SDBUS_CXX_ERROR_H_ 28 #define SDBUS_CXX_ERROR_H_ 43 :
public std::runtime_error
46 explicit Error(
const std::string& name,
const char* message =
nullptr)
47 :
Error(name, std::string(message ? message :
""))
51 Error(
const std::string& name,
const std::string& message)
52 : std::runtime_error(
"[" + name +
"] " + message)
58 const std::string& getName()
const 63 const std::string& getMessage()
const 70 return !getName().empty();
78 sdbus::Error createError(
int errNo,
const std::string& customMsg);
81 #define SDBUS_THROW_ERROR(_MSG, _ERRNO) \ 82 throw sdbus::createError((_ERRNO), (_MSG)) \ 85 #define SDBUS_THROW_ERROR_IF(_COND, _MSG, _ERRNO) \ 86 if (!(_COND)) ; else SDBUS_THROW_ERROR((_MSG), (_ERRNO)) \
Definition: AdaptorInterfaces.h:36