[Pkg-owncloud-commits] [owncloud-client] 222/333: Exxtract the exception message from reply to PUT
    Sandro Knauß 
    hefee-guest at moszumanska.debian.org
       
    Thu Apr 17 23:16:56 UTC 2014
    
    
  
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 38344589c438fc41fc440cd75ff96e2ede36ca82
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Mar 26 12:02:22 2014 +0100
    Exxtract the exception message from reply to PUT
    
    Might be usefull to debug Internal Server Error
    
    Fixes #1366
---
 src/mirall/propagator_qnam.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/mirall/propagator_qnam.cpp b/src/mirall/propagator_qnam.cpp
index 280382e..8126b66 100644
--- a/src/mirall/propagator_qnam.cpp
+++ b/src/mirall/propagator_qnam.cpp
@@ -191,8 +191,16 @@ void PropagateUploadFileQNAM::slotPutFinished()
                "It is restored and your edit is in the conflict file."))) {
             return;
         }
+        QString errorString = job->reply()->errorString();
 
-        done(classifyError(err, _item._httpErrorCode) , job->reply()->errorString());
+        QByteArray replyContent = job->reply()->readAll();
+        qDebug() << replyContent; // display the XML error in the debug
+        QRegExp rx("<s:message>(.*)</s:message>"); // Issue #1366: display server exception
+        if (rx.indexIn(QString::fromUtf8(replyContent)) != -1) {
+            errorString += QLatin1String(" (") + rx.cap(1) + QLatin1Char(')');
+        }
+
+        done(classifyError(err, _item._httpErrorCode), errorString);
         return;
     }
 
-- 
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