You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didnt want to comment on issue #16 but i see the same issue. i really just care about intercepting a 401 but the response console.log is never hit. even if its the only thing in there. responseError does tho.
fetchIntercept.register({
responseError: function(error) {
console.log('responseError', error)
}
});
fetchIntercept.register({
response: function(response) {
console.log('fetchIntercept response', response)
if (response.status >= 401) throw new Error('Request error');
return response;
}
});
// Call fetch to see your interceptors in action.
fetch('http://google.com');
The text was updated successfully, but these errors were encountered:
Hi!
I had the same problem. I've used the response interceptor with an async function that will check the response.ok and if its false, I call the function I created for the responseError with the response parameter as the error itself.
In essence, it's a bypass to the method that is already called for all other response status besides the 401.
hope it helps!
I didnt want to comment on issue #16 but i see the same issue. i really just care about intercepting a 401 but the response console.log is never hit. even if its the only thing in there. responseError does tho.
The text was updated successfully, but these errors were encountered: