Browse Source

added more information on initial connection error

AndyScherzinger 7 years ago
parent
commit
1167d46d93

+ 10 - 1
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -1559,8 +1559,17 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 mServerStatusText = getResources().getString(R.string.auth_oauth_error_access_denied);
                 break;
             case UNHANDLED_HTTP_CODE:
+                mServerStatusText = getResources().getString(R.string.auth_unknown_error_http_title);
+                break;
             case UNKNOWN_ERROR:
-                mServerStatusText = getResources().getString(R.string.auth_unknown_error_title);
+                if(result.getException() != null) {
+                    mServerStatusText = getResources().getString(
+                            R.string.auth_unknown_error_exception_title,
+                            result.getException().getMessage()
+                    );
+                } else {
+                    mServerStatusText = getResources().getString(R.string.auth_unknown_error_title);
+                }
                 break;
             case OK_REDIRECT_TO_NON_SECURE_CONNECTION:
                 mServerStatusIcon = R.drawable.ic_lock_open_white;

+ 3 - 1
src/main/res/values/strings.xml

@@ -239,7 +239,9 @@
 	<string name="auth_not_configured_title">Malformed server configuration</string>
 	<string name="auth_account_not_new">An account for the same user and server already exists on the device</string>
 	<string name="auth_account_not_the_same">The entered user does not match the user of this account</string>
-	<string name="auth_unknown_error_title">Unknown error occurred!</string>
+    <string name="auth_unknown_error_http_title">Unknown HTTP error occurred!</string>
+    <string name="auth_unknown_error_title">Unknown error occurred!</string>
+    <string name="auth_unknown_error_exception_title">Unknown error: %1$s</string>
 	<string name="auth_unknown_host_title">Could not find host</string>
 	<string name="auth_incorrect_path_title">Server not found</string>
 	<string name="auth_timeout_title">The server took too long to respond</string>