diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-21 18:50:35 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-23 17:38:15 +0200 |
commit | 646e552ba7410a925748ffe5e191ac577570f163 (patch) | |
tree | 424b725e2304af3201050f7a5d31fb15eefbd217 /common/clientapi.h | |
parent | ab750adc8c98bc33784498b4d06c36798f52ff4b (diff) | |
download | sink-646e552ba7410a925748ffe5e191ac577570f163.tar.gz sink-646e552ba7410a925748ffe5e191ac577570f163.zip |
Warning on command failure, null debugstream to ignore messages
Diffstat (limited to 'common/clientapi.h')
-rw-r--r-- | common/clientapi.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/common/clientapi.h b/common/clientapi.h index a01db23..4644ae1 100644 --- a/common/clientapi.h +++ b/common/clientapi.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "resultprovider.h" | 35 | #include "resultprovider.h" |
36 | #include "domain/applicationdomaintype.h" | 36 | #include "domain/applicationdomaintype.h" |
37 | #include "resourceconfig.h" | 37 | #include "resourceconfig.h" |
38 | #include "log.h" | ||
38 | 39 | ||
39 | namespace async { | 40 | namespace async { |
40 | //This should abstract if we execute from eventloop or in thread. | 41 | //This should abstract if we execute from eventloop or in thread. |
@@ -277,7 +278,9 @@ public: | |||
277 | //Potentially move to separate thread as well | 278 | //Potentially move to separate thread as well |
278 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceName(resourceIdentifier), resourceIdentifier); | 279 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceName(resourceIdentifier), resourceIdentifier); |
279 | if (facade) { | 280 | if (facade) { |
280 | facade->create(domainObject).exec().waitForFinished(); | 281 | facade->create(domainObject).template then<void>([](){}, [](int errorCode, const QString &error) { |
282 | Warning() << "Failed to create"; | ||
283 | }).exec().waitForFinished(); | ||
281 | } | 284 | } |
282 | //TODO return job? | 285 | //TODO return job? |
283 | } | 286 | } |
@@ -292,7 +295,9 @@ public: | |||
292 | //Potentially move to separate thread as well | 295 | //Potentially move to separate thread as well |
293 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceName(resourceIdentifier), resourceIdentifier); | 296 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceName(resourceIdentifier), resourceIdentifier); |
294 | if (facade) { | 297 | if (facade) { |
295 | facade->modify(domainObject).exec().waitForFinished(); | 298 | facade->modify(domainObject).template then<void>([](){}, [](int errorCode, const QString &error) { |
299 | Warning() << "Failed to modify"; | ||
300 | }).exec().waitForFinished(); | ||
296 | } | 301 | } |
297 | //TODO return job? | 302 | //TODO return job? |
298 | } | 303 | } |
@@ -305,7 +310,9 @@ public: | |||
305 | //Potentially move to separate thread as well | 310 | //Potentially move to separate thread as well |
306 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceName(resourceIdentifier), resourceIdentifier); | 311 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceName(resourceIdentifier), resourceIdentifier); |
307 | if (facade) { | 312 | if (facade) { |
308 | facade->remove(domainObject).exec().waitForFinished(); | 313 | facade->remove(domainObject).template then<void>([](){}, [](int errorCode, const QString &error) { |
314 | Warning() << "Failed to remove"; | ||
315 | }).exec().waitForFinished(); | ||
309 | } | 316 | } |
310 | //TODO return job? | 317 | //TODO return job? |
311 | } | 318 | } |