summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian <zerov83@gmail.com>2016-03-15 13:52:27 +0100
committerChristian <zerov83@gmail.com>2016-03-15 13:52:27 +0100
commitb04f9e165c0b80e23f94419a24332c527e39fa53 (patch)
tree223ad8547257c61de7373ce5952a7981d4c5a4c6
parent0049f41e432de2018bc1111b0e3fc0c5920ab7e8 (diff)
downloadvdr-plugin-plex-b04f9e165c0b80e23f94419a24332c527e39fa53.tar.gz
vdr-plugin-plex-b04f9e165c0b80e23f94419a24332c527e39fa53.tar.bz2
some fixes
-rw-r--r--PlexServer.cpp16
-rw-r--r--Plexservice.cpp5
2 files changed, 17 insertions, 4 deletions
diff --git a/PlexServer.cpp b/PlexServer.cpp
index 27f2e73..2fec22b 100644
--- a/PlexServer.cpp
+++ b/PlexServer.cpp
@@ -134,15 +134,25 @@ std::istream& PlexServer::MakeRequest(Poco::Net::HTTPResponse& response, bool& o
// Add PlexToken to Header
request.add("X-Plex-Token", GetAuthToken());
}
+ bool excep = false;
try {
GetClientSession()->sendRequest(request);
} catch (Poco::TimeoutException &exc) {
esyslog("[plex] Timeout: %s", path.c_str());
ok = false;
+ excep = true;
+ } catch (Poco::Exception &exc) {
+ esyslog("[plex] Oops Exception: %s", exc.displayText().c_str());
+ ok = false;
+ excep = true;
+ }
+ if(!excep) {
+ std::istream& stream = GetClientSession()->receiveResponse(response);
+ ok = response.getStatus() == 200;
+ return stream;
}
- std::istream& stream = GetClientSession()->receiveResponse(response);
- ok = response.getStatus() == 200;
- return stream;
+ static std::stringstream* ss;
+ return *ss;
}
diff --git a/Plexservice.cpp b/Plexservice.cpp
index dc755f1..366561d 100644
--- a/Plexservice.cpp
+++ b/Plexservice.cpp
@@ -117,7 +117,10 @@ void Plexservice::UpdateResources()
} catch (Poco::Net::NetException &exc) {
std::cout << exc.displayText() << std::endl;
return;
- }
+ } catch (Poco::Exception &exc) {
+ std::cout << exc.displayText() << std::endl;
+ return;
+ }
for(std::vector<Device>::iterator d_it = pContainer->m_vDevices.begin(); d_it != pContainer->m_vDevices.end(); ++d_it) {