X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/aa14479e5b2eefdbd654465ce2c9c90b171f6355..b0ab3ce0872d2702e82b5979dddaa5a897be340b:/src/com/owncloud/android/operations/RemoteOperationResult.java diff --git a/src/com/owncloud/android/operations/RemoteOperationResult.java b/src/com/owncloud/android/operations/RemoteOperationResult.java index b95f7340..0618b86d 100644 --- a/src/com/owncloud/android/operations/RemoteOperationResult.java +++ b/src/com/owncloud/android/operations/RemoteOperationResult.java @@ -57,7 +57,9 @@ public class RemoteOperationResult { NO_NETWORK_CONNECTION, SSL_ERROR, SSL_RECOVERABLE_PEER_UNVERIFIED, - BAD_OC_VERSION + BAD_OC_VERSION, + STORAGE_ERROR_MOVING_FROM_TMP, + CANCELLED } private boolean mSuccess = false; @@ -94,7 +96,10 @@ public class RemoteOperationResult { public RemoteOperationResult(Exception e) { mException = e; - if (e instanceof SocketException) { + if (e instanceof OperationCancelledException) { + mCode = ResultCode.CANCELLED; + + } else if (e instanceof SocketException) { mCode = ResultCode.WRONG_CONNECTION; } else if (e instanceof SocketTimeoutException) { @@ -132,6 +137,10 @@ public class RemoteOperationResult { return mSuccess; } + public boolean isCancelled() { + return mCode == ResultCode.CANCELLED; + } + public int getHttpCode() { return mHttpCode; } @@ -169,7 +178,10 @@ public class RemoteOperationResult { public String getLogMessage() { if (mException != null) { - if (mException instanceof SocketException) { + if (mException instanceof OperationCancelledException) { + return "Operation cancelled by the caller"; + + } else if (mException instanceof SocketException) { return "Socket exception"; } else if (mException instanceof SocketTimeoutException) { @@ -209,6 +221,9 @@ public class RemoteOperationResult { } else if (mCode == ResultCode.BAD_OC_VERSION) { return "No valid ownCloud version was found at the server"; + + } else if (mCode == ResultCode.STORAGE_ERROR_MOVING_FROM_TMP) { + return "Error while moving file from temporal to final directory"; } return "Operation finished with HTTP status code " + mHttpCode + " (" + (isSuccess()?"success":"fail") + ")";