aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/upnp/Device.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-18 13:47:12 +0100
committerMax Kellermann <max@duempel.org>2014-01-18 14:29:31 +0100
commit22dd3c8048a408a5c045164c439bb2f94b062fa3 (patch)
tree9165594ed801ce204c4e80d8f5b955ed9c69db86 /src/db/upnp/Device.cxx
parent04b7648e004a5f21c615aa36c0801ae0986baf1e (diff)
downloadmpd-22dd3c8048a408a5c045164c439bb2f94b062fa3.tar.gz
mpd-22dd3c8048a408a5c045164c439bb2f94b062fa3.tar.xz
mpd-22dd3c8048a408a5c045164c439bb2f94b062fa3.zip
db/upnp/Device: move code to method Parse()
Forward the Error to the caller.
Diffstat (limited to '')
-rw-r--r--src/db/upnp/Device.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/db/upnp/Device.cxx b/src/db/upnp/Device.cxx
index b5174236b..413d6ac99 100644
--- a/src/db/upnp/Device.cxx
+++ b/src/db/upnp/Device.cxx
@@ -21,7 +21,6 @@
#include "Device.hxx"
#include "Util.hxx"
#include "Expat.hxx"
-#include "Log.hxx"
#include "util/Error.hxx"
#include <stdlib.h>
@@ -99,16 +98,15 @@ protected:
}
};
-UPnPDevice::UPnPDevice(const std::string &url, const char *description)
- :ok(false)
+bool
+UPnPDevice::Parse(const std::string &url, const char *description,
+ Error &error)
{
- UPnPDeviceParser mparser(*this);
- Error error;
- if (!mparser.Parse(description, strlen(description), true,
- error)) {
- // TODO: pass Error to caller
- LogError(error);
- return;
+ {
+ UPnPDeviceParser mparser(*this);
+ if (!mparser.Parse(description, strlen(description),
+ true, error))
+ return false;
}
if (URLBase.empty()) {
@@ -129,5 +127,6 @@ UPnPDevice::UPnPDevice(const std::string &url, const char *description)
}
}
}
- ok = true;
+
+ return true;
}