Fix exception handling inside asio coroutine method_handler

By default sdbusplus catches exceptions from method handlers and
translates them to proper error message reply.
See asio/object_server.hpp:method_handler for reference.

This behavior is not kept when coroutine is used. If yield_context
was not yet used - exception is caught properly. In other cases
exception was 'leaking' and left unhandled, effectively crashing app.

Following change introduces exception handling similar to previously
mentioned implementation. In case of exception thrown from handler
in coroutine it is caught and translated to proper D-Bus error reply.

Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
Change-Id: Id86b77577a2547f999fa1a10ca4316ec0a9ac2d1
diff --git a/sdbusplus/exception.cpp b/sdbusplus/exception.cpp
index a0ecc8d..3727122 100644
--- a/sdbusplus/exception.cpp
+++ b/sdbusplus/exception.cpp
@@ -73,6 +73,11 @@
     return intf->sd_bus_error_get_errno(&this->error);
 }
 
+const sd_bus_error* SdBusError::get_error() const noexcept
+{
+    return &error;
+}
+
 void SdBusError::populateMessage(const char* prefix)
 {
     full_message = prefix;