Parse and show the error of invalid characters coming from the server side. Show...
[pub/Android/ownCloud.git] / src / com / owncloud / android / utils / ErrorMessageAdapter.java
index 9f13804..f7d7413 100644 (file)
@@ -1,4 +1,7 @@
-/* ownCloud Android client application
+/**
+ *   ownCloud Android client application
+ *
+ *   @author masensio
  *   Copyright (C) 2014 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
@@ -41,10 +44,8 @@ import com.owncloud.android.operations.UnshareLinkOperation;
 import com.owncloud.android.operations.UploadFileOperation;
 
 /**
- * Class to choose proper error messages to show to the user depending on the results of operations, always following the same policy
- * 
- * @author masensio
- *
+ * Class to choose proper error messages to show to the user depending on the results of operations,
+ * always following the same policy
  */
 
 public class ErrorMessageAdapter {
@@ -151,6 +152,8 @@ public class ErrorMessageAdapter {
             } else if (isNetworkError(result.getCode())) {
                 message = getErrorMessage(result, res);
                 
+            } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
+                message = res.getString(R.string.filename_forbidden_charaters_from_server);
             } else {
                 message = res.getString(R.string.create_dir_fail_msg);
             }