question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Broken interceptor error response

See original GitHub issue

Hello, I have upgraded axios from 0.12 to 0.16.2 and it looks like that interceptors response is quite diffrent:

Interceptor example code:

axios.interceptors.response.use(response => Promise.resolve(response), (error) => {
  console.log(error);
  return Promise.reject(error);
});

On version 0.12 it returns nice object:

screenshot 2017-09-14 14 01 29

However on version 0.16.2 it seems to return error stack for the request:

screenshot 2017-09-14 13 59 00

Making interceptors in axios quite useless in my project (I am using it to refresh access token for logged user).

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:15

github_iconTop GitHub Comments

5reactions
hoffincommented, Dec 28, 2017

Using v0.17.1

Also the same here, error.response is undefined.

Object.keys(error).forEach(key => console.log(key)) returns config, request, response

but error.response returns undefined. So it’s there but undefined.

5reactions
m0ngr31commented, Nov 15, 2017

Seems to be broken for me as well. Only keys are config and request. Can’t get the status code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular: Handle HTTP Errors using Interceptors
An error interceptor is a special type of interceptor which is used for handling errors that arise while making an HTTP request.
Read more >
Broken interceptor detected: Config object not supplied in ...
Somewhere in your code you have a interceptor for $httpProvider which doesn't have a proper response error section, something like this :
Read more >
Handling HTTP Error Messages `Globally` using Interceptors ...
Handle all HTTP error messages in your whole Angular app using Interceptors and NGX-Toaster. What are Interceptors?
Read more >
Error handling - Express.js
Error Handling refers to how Express catches and processes errors that occur both synchronously and asynchronously. Express comes with a default error ......
Read more >
Angular Error Interceptor - Satyapriya Mishra
An error interceptor is a special type of interceptor which is used for handling errors that arise while making an HTTP request. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found