title: File Errors in Android Cordova
body: <p>I thought I'd post this as it may be useful to others, I've struggled with the error feedback while lodging files in an Android/Cordova hybrid application. The following blocks of code should make it easier - however any pointers for improvement are very welcome.</p>
  
  <pre><code>    fail: function(error) { 
          var logger = cordova.require("salesforce/util/logger");
  
          switch(error.code)
          {
              case FileError.NOT_FOUND_ERR:
                  logger.logToConsole("File Not Found");
                  break;
              case FileError.SECURITY_ERR:
                  logger.logToConsole("Security Error");
                  break;
              case FileError.ABORT_ERR:
                  logger.logToConsole("Abort error");
                  break;
              case FileError.NOT_READABLE_ERR:
                  logger.logToConsole("Not Readable");
                  break;
              case FileError.ENCODING_ERR:
                  logger.logToConsole("Encoding Error");
                  break;
              case FileError.NO_MODIFICATION_ALLOWED_ERR:
                  logger.logToConsole("No Modification Allowed");
                  break;
              case FileError.INVALID_STATE_ERR:
                  logger.logToConsole("Invalid State");
                  break;
              case FileError.SYNTAX_ERR:
                  logger.logToConsole("Syntax Error");
                  break;
              case FileError.INVALID_MODIFICATION_ERR:
                  logger.logToConsole("Invalid Modification Error");
                  break;
              case FileError.QUOTA_EXCEEDED_ERR:
                  logger.logToConsole("Quota Exceeded");
                  break;
              case FileError.TYPE_MISMATCH_ERR:
                  logger.logToConsole("Type Mismatch Error");
                  break;
              case FileError.PATH_EXISTS_ERR:
                  logger.logToConsole("Path Already Exists Error");
                  break;
          }
          logger.logToConsole("Error code:: " + error.code);
      }
  </code></pre>