summaryrefslogtreecommitdiffstats
path: root/common/resourcecontrol.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-31 14:04:03 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-10-31 14:04:03 +0100
commite1a3aebafca9a9447a393100db4fc45943551630 (patch)
tree39672297b576e967bd2448d6a795e5485f6995b7 /common/resourcecontrol.cpp
parent77b2173e73f16f33648226543788ea67096fb6d6 (diff)
downloadsink-e1a3aebafca9a9447a393100db4fc45943551630.tar.gz
sink-e1a3aebafca9a9447a393100db4fc45943551630.zip
Ensure we get an appropriate exit code when a resource crashes.
Diffstat (limited to 'common/resourcecontrol.cpp')
-rw-r--r--common/resourcecontrol.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/resourcecontrol.cpp b/common/resourcecontrol.cpp
index b6a4c0b..a69b7fa 100644
--- a/common/resourcecontrol.cpp
+++ b/common/resourcecontrol.cpp
@@ -101,10 +101,13 @@ KAsync::Job<void> ResourceControl::flush(Flush::FlushType type, const QByteArray
101 SinkTrace() << "Waiting for flush completion notification " << id; 101 SinkTrace() << "Waiting for flush completion notification " << id;
102 notifier->registerHandler([&future, id](const Notification &notification) { 102 notifier->registerHandler([&future, id](const Notification &notification) {
103 SinkTrace() << "Received notification: " << notification.type << notification.id; 103 SinkTrace() << "Received notification: " << notification.type << notification.id;
104 if (notification.id == id) { 104 if (notification.type == Notification::Error && notification.code == ApplicationDomain::ResourceCrashedError) {
105 SinkWarning() << "Error during flush";
106 future.setError(-1, "Error during flush: " + notification.message);
107 } else if (notification.id == id) {
105 SinkTrace() << "FlushComplete"; 108 SinkTrace() << "FlushComplete";
106 if (notification.code) { 109 if (notification.code) {
107 SinkWarning() << "Flush return an error"; 110 SinkWarning() << "Flush returned an error";
108 future.setError(-1, "Flush returned an error: " + notification.message); 111 future.setError(-1, "Flush returned an error: " + notification.message);
109 } else { 112 } else {
110 future.setFinished(); 113 future.setFinished();