Skip to content
Snippets Groups Projects
Commit 7778a33e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '293-minervanet-error-report-11831' into 'main'

Resolve "MINERVANET - Error Report 11831"

See merge request !246
parents 814abfe6 cb1fe59a
No related branches found
Tags v18.0.0-beta.4
2 merge requests!264Resolve "add support for matomo",!246Resolve "MINERVANET - Error Report 11831"
Pipeline #95530 passed
minerva-front (18.0.0~beta.4) stable; urgency=medium
* Bugfix: connectivity issue should report a problem with network instead of
submitting error report(#293)
* Bugfix: source map for js was missing (#292)
* Bugfix: sometimes project don't have link to disease or organism, this
crashed listing of projects after log in (#290)
......
......@@ -3,6 +3,9 @@ import { Action, createListenerMiddleware, isRejected } from '@reduxjs/toolkit';
import { createErrorData } from '@/utils/error-report/errorReporting';
import { openAccessDeniedModal, openErrorReportModal } from '@/redux/modal/modal.slice';
import { getProjects } from '@/redux/projects/projects.thunks';
import axios from 'axios';
import { AXIOS_ERROR_NETWORK } from '@/utils/getErrorMessage/getErrorMessage.constants';
import { showToast } from '@/utils/showToast';
export const errorListenerMiddleware = createListenerMiddleware();
......@@ -16,6 +19,17 @@ export const errorMiddlewareListener = async (
if (action.error.code === '403') {
dispatch(getProjects());
dispatch(openAccessDeniedModal());
} else if (axios.isAxiosError(action.error) && action.error.code === AXIOS_ERROR_NETWORK) {
// eslint-disable-next-line no-console
console.log(action.error);
showToast({
type: 'error',
message:
'There was a problem with fetching data from minerva server. ' +
'Please check your internet connection and try again. ' +
'If problem problem persists contact system administrator.',
duration: 15000,
});
} else {
const errorData = await createErrorData(action.error, getState());
dispatch(openErrorReportModal(errorData));
......
......@@ -2,6 +2,7 @@ export const UNKNOWN_ERROR = 'An unknown error occurred. Please try again later.
export const UNKNOWN_AXIOS_ERROR_CODE = 'UNKNOWN_AXIOS_ERROR';
export const NOT_FOUND_AXIOS_ERROR_CODE = '404';
export const GENERIC_AXIOS_ERROR_CODE = 'ERR_BAD_REQUEST';
export const AXIOS_ERROR_NETWORK = 'ERR_NETWORK';
export const HTTP_ERROR_MESSAGES = {
400: "The server couldn't understand your request. Please check your input and try again.",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment