Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/it/niedermann/nextcloud/deck/exceptions/OfflineException.java1
-rw-r--r--app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandler.java4
2 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/exceptions/OfflineException.java b/app/src/main/java/it/niedermann/nextcloud/deck/exceptions/OfflineException.java
index 1415659a5..946f7b049 100644
--- a/app/src/main/java/it/niedermann/nextcloud/deck/exceptions/OfflineException.java
+++ b/app/src/main/java/it/niedermann/nextcloud/deck/exceptions/OfflineException.java
@@ -27,6 +27,7 @@ public class OfflineException extends IllegalStateException {
OFFLINE("Device is currently offline", R.string.error_dialog_tip_offline_no_internet),
CONNECTION_REFUSED("Connection refused", R.string.error_dialog_tip_offline_connection_refused),
CONNECTION_TIMEOUT("Connection timeout", R.string.error_dialog_tip_offline_connection_timeout),
+ CONNECTION_REJECTED("Connection rejected", R.string.error_dialog_tip_connection_rejected),
;
private final String key;
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandler.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandler.java
index 562e9c3cb..656aed0ce 100644
--- a/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandler.java
+++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandler.java
@@ -2,6 +2,7 @@ package it.niedermann.nextcloud.deck.remote.api;
import androidx.annotation.NonNull;
+import com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException;
import com.nextcloud.android.sso.exceptions.UnknownErrorException;
import java.util.Arrays;
@@ -16,7 +17,8 @@ public class ServerCommunicationErrorHandler {
private static final Handler[] handlers = new Handler[]{
new Handler(UnknownErrorException.class, Arrays.asList("econnrefused", "unable to resolve host",
"connection refused", "no address associated with hostname"), OfflineException.Reason.CONNECTION_REFUSED),
- new Handler(ClassNotFoundException.class, Collections.singletonList("connecttimeoutexception"), OfflineException.Reason.CONNECTION_TIMEOUT)
+ new Handler(ClassNotFoundException.class, Collections.singletonList("connecttimeoutexception"), OfflineException.Reason.CONNECTION_TIMEOUT),
+ new Handler(NextcloudHttpRequestFailedException.class, Collections.singletonList("520"), OfflineException.Reason.CONNECTION_REJECTED)
};
public static Throwable translateError(Throwable error) {