[Pkg-owncloud-commits] [owncloud-client] 42/484: Network errors: Use exception name, if message is empty #2718
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:08 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 9f8d109a7ec3363a38a5b3f96a8ff87029fd2090
Author: Christian Kamm <mail at ckamm.de>
Date: Fri Oct 2 15:25:34 2015 +0200
Network errors: Use exception name, if message is empty #2718
---
src/libsync/abstractnetworkjob.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/libsync/abstractnetworkjob.cpp b/src/libsync/abstractnetworkjob.cpp
index ed675cd..599e5be 100644
--- a/src/libsync/abstractnetworkjob.cpp
+++ b/src/libsync/abstractnetworkjob.cpp
@@ -263,13 +263,21 @@ QString extractErrorMessage(const QByteArray& errorResponse)
return QString::null;
}
+ QString exception;
while (!reader.atEnd() && reader.error() == QXmlStreamReader::NoError) {
reader.readNextStartElement();
if (reader.name() == QLatin1String("message")) {
- return reader.readElementText();
+ QString message = reader.readElementText();
+ if (!message.isEmpty()) {
+ return message;
+ }
+ } else if (reader.name() == QLatin1String("exception")) {
+ exception = reader.readElementText();
}
+
}
- return QString::null;
+ // Fallback, if message could not be found
+ return exception;
}
QString errorMessage(const QString& baseError, const QByteArray& body)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list