1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-07-23 18:06:17 +00:00

Handle 503 code error

This commit is contained in:
davigonz 2016-12-23 10:50:51 +01:00
parent 45e70f5906
commit 0fdc5694f1
2 changed files with 43 additions and 37 deletions

View File

@ -3,7 +3,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.android.tools.build:gradle:2.2.3'
} }
} }

View File

@ -34,6 +34,7 @@ import java.net.SocketException;
import java.net.SocketTimeoutException; import java.net.SocketTimeoutException;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.ArrayList; import java.util.ArrayList;
import android.accounts.Account; import android.accounts.Account;
import android.accounts.AccountsException; import android.accounts.AccountsException;
@ -61,7 +62,8 @@ import javax.net.ssl.SSLException;
*/ */
public class RemoteOperationResult implements Serializable { public class RemoteOperationResult implements Serializable {
/** Generated - should be refreshed every time the class changes!! */; /** Generated - should be refreshed every time the class changes!! */
;
private static final long serialVersionUID = 1129130415603799707L; private static final long serialVersionUID = 1129130415603799707L;
private static final String TAG = RemoteOperationResult.class.getSimpleName(); private static final String TAG = RemoteOperationResult.class.getSimpleName();
@ -112,7 +114,8 @@ public class RemoteOperationResult implements Serializable {
WRONG_SERVER_RESPONSE, WRONG_SERVER_RESPONSE,
INVALID_CHARACTER_DETECT_IN_SERVER, INVALID_CHARACTER_DETECT_IN_SERVER,
DELAYED_FOR_WIFI, DELAYED_FOR_WIFI,
LOCAL_FILE_NOT_FOUND LOCAL_FILE_NOT_FOUND,
MAINTENANCE_MODE
} }
private boolean mSuccess = false; private boolean mSuccess = false;
@ -160,6 +163,9 @@ public class RemoteOperationResult implements Serializable {
case HttpStatus.SC_FORBIDDEN: case HttpStatus.SC_FORBIDDEN:
mCode = ResultCode.FORBIDDEN; mCode = ResultCode.FORBIDDEN;
break; break;
case HttpStatus.SC_SERVICE_UNAVAILABLE:
mCode = ResultCode.MAINTENANCE_MODE;
break;
default: default:
mCode = ResultCode.UNHANDLED_HTTP_CODE; mCode = ResultCode.UNHANDLED_HTTP_CODE;
Log_OC.d(TAG, "RemoteOperationResult has processed UNHANDLED_HTTP_CODE: " + Log_OC.d(TAG, "RemoteOperationResult has processed UNHANDLED_HTTP_CODE: " +