title: Handle Angular $http errors locally with fallback to global error handling
body: <p>I have a component based Angular application where the individual components load their respective data. When errors occur I generally want the component to display an error message.</p>
  
  <p>However, in some cases I'd like the component to ignore the error and leave it up to some global error handling mechanism to catch it. </p>
  
  <p>Interceptor:</p>
  
  <pre><code>angular.module("...").factory("httpInterceptor", function($q) {
      return {
          responseError: function(response) {
              // (1)
              return $q.reject("I AM CALLED FIRST") 
          }
  })
  </code></pre>
  
  <p>Serivce:</p>
  
  <pre><code>angular.module("...").service("myService", function($http){
      return {
          fetchData: function(){
              return $http.get("...")    
          }
      }
  })
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>angular.module("...").controller("MyController", function(myService){
      myService.fetchData()
          .then(function(){ ... })
          .catch(function() { 
             // (2) 
             //I AM CALLED LAST
          })
  })
  </code></pre>
  
  <p>In most cases i want the error to be handled in the controller (at point (2)). If the controller decides to ignore the error (omit the catch) the error can still be caught in the interceptor. </p>
  
  <p>The problem is that the interceptor doesn't know whether the controller intends to catch the error or not, since it's being called before the controller. Therefore the interceptor does not know whether it should display an error or not (I don't want both a global and a local error message).</p>
  
  <p><strong>How can I catch http errors ignored by the controller?</strong></p>