Created
June 12, 2023 16:54
-
-
Save abimaelmartell/7348a05c2a19dde1a308c3e4cbac28b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios.interceptors.response.use( | |
(response) => response, | |
(error) => { | |
if (defaultAxios.isAxiosError(error)) { | |
throw new Error( | |
`Failed Request to ${error.config.url} with ${JSON.stringify( | |
error.config.data | |
)} with status ${error.response?.status} and data ${JSON.stringify( | |
error.response?.data | |
)}` | |
) | |
} | |
throw error | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment