Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

[SOLVED] Http interceptors problem

$
0
0

@blocknotes wrote:

I pushed a simple http interceptor in $httpProvider that logs every response (also for resources):

'response': function( response ) {
  console.log( response.config.url + ': ' + response.status );
  return response;
}

When status is 200 all goes well. But when there is a status code 401 the interceptor is ignored and in logs it seems catched by ionic bundle:

error: GET http://MY_URL 401 (Unauthorized) - ionic.bundle.js:19341

After the resource function call the reject function is called so I can see the response status from there, but the interceptor doesn't log a line.

Any idea?

Posts: 4

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>