Skip to content

Commit

Permalink
Add error logging in response interceptor for better debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
clari182 committed Dec 18, 2024
1 parent 47a1be7 commit eb32184
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions site/gatsby-site/netlify/functions/parseNews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const getHtmlWithCookies = async (url) => {
axiosInstance.interceptors.response.use(
(response) => response,
(error) => {
console.log('Intercepted error', error.message, error.response);
if (error.response && [301, 302].includes(error.response.status)) {
const redirectUrl = error.response.headers.location;

Expand Down

0 comments on commit eb32184

Please sign in to comment.