From 30b335f8eb048beb64016cbcea4c7b7ca2e6c3ce Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 16 Jun 2021 20:18:59 +0100 Subject: [PATCH] keeping some code that was used to test exception interception --- src/js/axios-instance.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/js/axios-instance.js b/src/js/axios-instance.js index 63487170a..3615c1d13 100644 --- a/src/js/axios-instance.js +++ b/src/js/axios-instance.js @@ -39,4 +39,16 @@ axiosInstance.interceptors.request.use( } ); +axiosInstance.interceptors.response.use((response) => response, (error) => { + // whatever you want to do with the error + // console.log('interctepted'); + // if(error.response.data.message){ + // Notifications.add(`${error.response.data.message}`); + // }else{ + // Notifications.add(`${error.response.status} ${error.response.statusText}`); + // } + // return error.response; + throw error; +}); + export default axiosInstance;