title: Ext JS 4's File Upload and Internal Server Error
body: <p>Here we go again with Ext JS.</p>
  
  <p>Suppose I have a file upload (Ext.form.field.File) field that submits an image to the app's Web Server.</p>
  
  <p>Whenever I get an Internal Server Error (status code = 500) on the form's submission (ie: the posted file is bigger than the Web Server's max request length) Ext throws an Exception that show's on the browser's Console.</p>
  
  <p>I can promptly catch the error if I override Ext.Error.handle like this:</p>
  
  <pre><code>&lt;!-- language: js --&gt;
  Ext.Error.handle = function (err) {
  
      switch (err.sourceClass) {
          case "Ext.JSON":
              {
                  var arr = err.msg.split('\n');
                  var msg = arr[0];
                  arr.shift();
                  var serverMsg = arr.join('\n');
  
                  LogManager.error(msg);
                  return true;
              }
          default:
              {
                  if (err.msg) {
                      LogManager.error(err.msg);
                      return true;
                  }
              }
              return false;
      }
  }
  </code></pre>
  
  <p>Problem is regardless I catch the error or not the modal progress bar Ext creates remains displayed, meaning my application is locked for good.</p>
  
  <p>Question is: How do I make Ext fire the form's failure callback and close the progress bar in a pleasant way?</p>