Merge branch 'master' of github.com:owncloud/android into setAsWallpaper
[pub/Android/ownCloud.git] / src / com / owncloud / android / utils / ErrorMessageAdapter.java
index c86346b..945f70f 100644 (file)
@@ -206,9 +206,10 @@ public class ErrorMessageAdapter {
             }
         } else if (operation instanceof MoveFileOperation) {
 
             }
         } else if (operation instanceof MoveFileOperation) {
 
-            if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+            if(isNetworkError(result.getCode())){
+                message = getErrorMessage(result, res);
+            } else if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
                 message = res.getString(R.string.move_file_not_found);
                 message = res.getString(R.string.move_file_not_found);
-
             } else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT) {
                 message = res.getString(R.string.move_file_invalid_into_descendent);
 
             } else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT) {
                 message = res.getString(R.string.move_file_invalid_into_descendent);
 
@@ -237,16 +238,16 @@ public class ErrorMessageAdapter {
 
                 } else {    // Generic error
                     // Show a Message, operation finished without success
 
                 } else {    // Generic error
                     // Show a Message, operation finished without success
-                    message = String.format(res.getString(R.string.download_folder_failed_content),
+                    message = String.format(res.getString(R.string.sync_folder_failed_content),
                             folderPathName);
                 }
             }
         } else if (operation instanceof CopyFileOperation) {
                             folderPathName);
                 }
             }
         } else if (operation instanceof CopyFileOperation) {
-
-            if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+            if(isNetworkError(result.getCode())){
+                message = getErrorMessage(result, res);
+            } else if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
                 message = res.getString(R.string.copy_file_not_found);
                 message = res.getString(R.string.copy_file_not_found);
-
-            } else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT) {
+            } else if (result.getCode() == ResultCode.INVALID_COPY_INTO_DESCENDANT) {
                 message = res.getString(R.string.copy_file_invalid_into_descendent);
 
             } else if (result.getCode() == ResultCode.INVALID_OVERWRITE) {
                 message = res.getString(R.string.copy_file_invalid_into_descendent);
 
             } else if (result.getCode() == ResultCode.INVALID_OVERWRITE) {