summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-18 14:59:14 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-18 14:59:14 +0100
commitf5e522bb48caa5dd002a7dbaf830e88406bf6788 (patch)
tree03d9c02138264067c0d43bc25753ec1020fde230 /common
parentceac3a797d161c985365b304ae7a15268b90ba09 (diff)
downloadsink-f5e522bb48caa5dd002a7dbaf830e88406bf6788.tar.gz
sink-f5e522bb48caa5dd002a7dbaf830e88406bf6788.zip
Improved debug output
Diffstat (limited to 'common')
-rw-r--r--common/resourceaccess.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp
index 817b7eb..40e403c 100644
--- a/common/resourceaccess.cpp
+++ b/common/resourceaccess.cpp
@@ -160,8 +160,9 @@ KAsync::Job<QSharedPointer<QLocalSocket>> ResourceAccess::connectToServer(const
160 }); 160 });
161 QObject::connect(s.data(), static_cast<void (QLocalSocket::*)(QLocalSocket::LocalSocketError)>(&QLocalSocket::error), context, [&future, &s, context](QLocalSocket::LocalSocketError localSocketError) { 161 QObject::connect(s.data(), static_cast<void (QLocalSocket::*)(QLocalSocket::LocalSocketError)>(&QLocalSocket::error), context, [&future, &s, context](QLocalSocket::LocalSocketError localSocketError) {
162 const auto errorString = s->errorString(); 162 const auto errorString = s->errorString();
163 const auto name = s->fullServerName();
163 delete context; 164 delete context;
164 future.setError(localSocketError, "Failed to connect to socket: " + errorString); 165 future.setError(localSocketError, QString("Failed to connect to socket %1: %2").arg(name).arg(errorString));
165 }); 166 });
166 s->connectToServer(identifier); 167 s->connectToServer(identifier);
167 }); 168 });
@@ -181,7 +182,7 @@ KAsync::Job<void> ResourceAccess::Private::tryToConnect()
181 static int waitTime = 10; 182 static int waitTime = 10;
182 static int timeout = 20000; 183 static int timeout = 20000;
183 static int maxRetries = timeout / waitTime; 184 static int maxRetries = timeout / waitTime;
184 if (*counter > maxRetries) { 185 if (*counter >= maxRetries) {
185 SinkTrace() << "Giving up after " << *counter << "tries"; 186 SinkTrace() << "Giving up after " << *counter << "tries";
186 return KAsync::error<KAsync::ControlFlowFlag>(error); 187 return KAsync::error<KAsync::ControlFlowFlag>(error);
187 } else { 188 } else {