title: Angularjs promise rejection chaining
body: <p>I need to create chained promises:</p>
  
  <pre><code>var deferred = $q.defer();
  $timeout(function() {
      deferred.reject({result: 'errror'});
  }, 3000);
  deferred.promise.then(angular.noop, function errorHandler(result) {
      //some actions
      return result;
  }).then(function successCallback(result) {
      console.log('what do I do here?');
      return result;
  }, function errorCallback(result) {
     $scope.result= result;
     return result;
  });
  </code></pre>
  
  <p>If I put an errorCallback into the first <code>then</code>, the second <code>then</code> will be resolved and its successCallback will be called . But if I remove <code>errorHandler</code> then second promise will be rejected.</p>
  
  <p>According to Angular JS docs the only way to propagate rejection is to return <code>$q.reject();</code> and it looks not obvious, especially because I have to inject <code>$q</code> service even if it is not needed;</p>
  
  <p>It can also be done by throwing an exception in <code>errorHandler</code>, but it writes exception trace to console, it is not good.</p>
  
  <p>Is there another option to do this in a clear way? And what is the reason? Why it is done? In which case, the current behavior can be useful?</p>