diff --git a/src/services/HttpService.ts b/src/services/HttpService.ts index 4f9948b9..34a58e96 100644 --- a/src/services/HttpService.ts +++ b/src/services/HttpService.ts @@ -18,7 +18,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import { setSnackbarMessage } from '../features/notifiication/slice'; import { store } from '../features/store'; @@ -40,9 +40,9 @@ abstract class HttpService { (response: AxiosResponse) => { return response; }, - async (error: AxiosError) => { + async error => { // in order to get the error message from blob type response, it should be parsed - const errorMessage = JSON.parse(await error.response.data.text()).msg; + const errorMessage = await error.response.data.msg; // Need to remove this store usage to avoid circlular dependecy issues store.dispatch( setSnackbarMessage({