Merge lp:~stolowski/unity-scopes-api/fix-lp-1401560 into lp:unity-scopes-api

Proposed by Paweł Stołowski
Status: Merged
Approved by: Michi Henning
Approved revision: 274
Merged at revision: 274
Proposed branch: lp:~stolowski/unity-scopes-api/fix-lp-1401560
Merge into: lp:unity-scopes-api
Diff against target: 12 lines (+1/-1)
1 file modified
src/scopes/internal/smartscopes/SmartScopesClient.cpp (+1/-1)
To merge this branch: bzr merge lp:~stolowski/unity-scopes-api/fix-lp-1401560
Reviewer Review Type Date Requested Status
Michi Henning (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+244484@code.launchpad.net

Commit message

Use get() on future of the http request to get exceptions reported when error occur (std::future::wait() doesn't throw).

Description of the change

Use get() on future of the http request to get exceptions reported when error occur (std::future::wait() doesn't throw). We have exception handling around this code that switches to cached data from last successful call to remote-scopes, but because it was never triggered, we were always trying to parse JSON (which was empty on connection error).

Please see the bug report linked to this branch for steps to reproduce.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

I fixed a bunch of these some time ago, but missed this one. Thanks for catching this!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scopes/internal/smartscopes/SmartScopesClient.cpp'
2--- src/scopes/internal/smartscopes/SmartScopesClient.cpp 2014-12-11 10:41:31 +0000
3+++ src/scopes/internal/smartscopes/SmartScopesClient.cpp 2014-12-11 18:32:35 +0000
4@@ -198,7 +198,7 @@
5 HttpResponseHandle::SPtr response = http_client_->get(remote_scopes_uri.str(), [&response_str](std::string const& replyLine) {
6 response_str += replyLine; // accumulate all reply lines
7 }, headers);
8- response->wait();
9+ response->get();
10
11 BOOST_LOG_SEV(logger_, Logger::Info)
12 << "SmartScopesClient.get_remote_scopes(): Remote scopes:\n" << response_str;

Subscribers

People subscribed via source and target branches

to all changes: