title: How to change response error to success response?
body: <p>Can I change error response (for example timeout) to success response in interceptor?</p>
  
  <p>I try to cache response when success and return cached response when I get error.
  I tried the following:</p>
  
  <pre><code>{
    response: function (response) {
        cache[response.config.url] = response;
    }, 
    responseError: function (rejection) {
      if (cache[rejection.config.url] != null) {
         $q.resolve(cache[rejection.config.url]);
      }
    return rejection;
    }
  }
  </code></pre>
  
  <p>but it doesn't work.</p>