title: Why is my error handling with jquery deferred and jsonp data not working?
body: <p>I am just trying to figure out the <code>deferred</code> api and have this nice sample code going with the twitter search api:</p>
  
  <pre><code>var getTweets = function(q) {
      return $.ajax({
          url: 'http://search.twitter.com/search.json?q=' + encodeURIComponent(q),
          dataType: 'jsonp'
      })
  };
  
  var getTheDay = function(date){
      var date = new Date(date);
      return date.getDay();
  }
  
  var parseTweetData = function(data){
      $.each(data.results, function(index, tweet){
          console.log(tweet.text 
          + ' from ' + tweet.from_user_name 
          + ' at ' + getTheDay(Date.parse(tweet.created_at) * 1000));
      });
  }
  
  var parseError = function(error, xhr) {
      alert('failed')
  };
  
  $.when(getTweets(' martin')).then(parseTweetData, parseError);
  </code></pre>
  
  <p>Getting results back is just fine. The problem comes with the situation where twitter returns a <a href="http://d.pr/i/7Ax6" rel="nofollow">403 error</a>. </p>
  
  <p>I want to handle that error with my custom error handler but that doesn't seem to be triggered at all. What am I doing wrong? Have I misunderstood the api? How do I write a proper ajax error handler request?</p>