[Pkg-owncloud-commits] [owncloud-client] 118/164: Output a more sensible error message for auth errors

Sandro Knauß hefee-guest at moszumanska.debian.org
Sun Mar 22 11:57:01 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 071177cee2165c5ffcaf7d1b42dd5cbfc6e6a71a
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Tue Mar 10 12:14:14 2015 +0100

    Output a more sensible error message for auth errors
---
 src/gui/folderwizard.cpp            | 9 +++++++--
 src/libsync/connectionvalidator.cpp | 8 ++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp
index c1a583f..d676084 100644
--- a/src/gui/folderwizard.cpp
+++ b/src/gui/folderwizard.cpp
@@ -19,6 +19,7 @@
 #include "networkjobs.h"
 #include "account.h"
 #include "selectivesyncdialog.h"
+#include "creds/abstractcredentials.h"
 
 #include <QDebug>
 #include <QDesktopServices>
@@ -293,8 +294,12 @@ void FolderWizardRemotePath::slotCreateRemoteFolderFinished(QNetworkReply::Netwo
 void FolderWizardRemotePath::slotHandleNetworkError(QNetworkReply *reply)
 {
     qDebug() << "** webdav mkdir request failed:" << reply->error();
-    showWarn(tr("Failed to create the folder on %1. Please check manually.")
-             .arg(Theme::instance()->appNameGUI()));
+    if( reply && !_account->credentials()->stillValid(reply) ) {
+        showWarn(tr("Authentication failed accessing %1").arg(Theme::instance()->appNameGUI()));
+    } else {
+        showWarn(tr("Failed to create the folder on %1. Please check manually.")
+                 .arg(Theme::instance()->appNameGUI()));
+    }
 }
 
 static QTreeWidgetItem* findFirstChild(QTreeWidgetItem *parent, const QString& text)
diff --git a/src/libsync/connectionvalidator.cpp b/src/libsync/connectionvalidator.cpp
index e586fb3..b9da29f 100644
--- a/src/libsync/connectionvalidator.cpp
+++ b/src/libsync/connectionvalidator.cpp
@@ -104,8 +104,12 @@ void ConnectionValidator::slotStatusFound(const QUrl&url, const QVariantMap &inf
 // status.php could not be loaded (network or server issue!).
 void ConnectionValidator::slotNoStatusFound(QNetworkReply *reply)
 {
-    _errors.append(tr("Unable to connect to %1").arg(_account->url().toString()));
-    _errors.append( reply->errorString() );
+    if( reply && ! _account->credentials()->stillValid(reply)) {
+        _errors.append(tr("Authentication error: Either username or password are wrong."));
+    }  else {
+        _errors.append(tr("Unable to connect to %1").arg(_account->url().toString()));
+        _errors.append( reply->errorString() );
+    }
     reportResult( StatusNotFound );
 }
 

-- 
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