Add class params to the DBus* exception messages

In the DBusMethodError, DBusServiceError, and DBusPropertyError classes,
add the class members into the constructor's message argument so they
will be displayed using the what() method.  This would help for debug
when an application crashes due to one of these uncaught exceptions
and the what() output is written to the journal.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I6f275a327149275b3ff3a34042793fdf407816ba
diff --git a/sdbusplus.hpp b/sdbusplus.hpp
index 3da6f93..16bd083 100644
--- a/sdbusplus.hpp
+++ b/sdbusplus.hpp
@@ -1,5 +1,7 @@
 #pragma once
 
+#include <fmt/format.h>
+
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/elog.hpp>
 #include <phosphor-logging/log.hpp>
@@ -32,7 +34,7 @@
 class DBusError : public std::runtime_error
 {
   public:
-    explicit DBusError(const char* msg) : std::runtime_error(msg)
+    explicit DBusError(const std::string& msg) : std::runtime_error(msg)
     {}
 };
 
@@ -46,7 +48,8 @@
   public:
     DBusMethodError(const std::string& busName, const std::string& path,
                     const std::string& interface, const std::string& method) :
-        DBusError("DBus method call failed"),
+        DBusError(fmt::format("DBus method failed: {} {} {} {}", busName, path,
+                              interface, method)),
         busName(busName), path(path), interface(interface), method(method)
     {}
 
@@ -66,8 +69,9 @@
 {
   public:
     DBusServiceError(const std::string& path, const std::string& interface) :
-        DBusError("DBus service lookup failed"), path(path),
-        interface(interface)
+        DBusError(
+            fmt::format("DBus service lookup failed: {} {}", path, interface)),
+        path(path), interface(interface)
     {}
 
     const std::string path;
@@ -82,10 +86,11 @@
 class DBusPropertyError : public DBusError
 {
   public:
-    DBusPropertyError(const char* msg, const std::string& busName,
+    DBusPropertyError(const std::string& msg, const std::string& busName,
                       const std::string& path, const std::string& interface,
                       const std::string& property) :
-        DBusError(msg),
+        DBusError(msg + fmt::format(": {} {} {} {}", busName, path, interface,
+                                    property)),
         busName(busName), path(path), interface(interface), property(property)
     {}