Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
frontend
Commits
cb1fe59a
Commit
cb1fe59a
authored
5 months ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
don't send report when there is a problem with connectivity
parent
814abfe6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!264
Resolve "add support for matomo"
,
!246
Resolve "MINERVANET - Error Report 11831"
Pipeline
#95377
passed
5 months ago
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG
+2
-0
2 additions, 0 deletions
CHANGELOG
src/redux/middlewares/error.middleware.ts
+14
-0
14 additions, 0 deletions
src/redux/middlewares/error.middleware.ts
src/utils/getErrorMessage/getErrorMessage.constants.ts
+1
-0
1 addition, 0 deletions
src/utils/getErrorMessage/getErrorMessage.constants.ts
with
17 additions
and
0 deletions
CHANGELOG
+
2
−
0
View file @
cb1fe59a
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)
...
...
This diff is collapsed.
Click to expand it.
src/redux/middlewares/error.middleware.ts
+
14
−
0
View file @
cb1fe59a
...
...
@@ -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
));
...
...
This diff is collapsed.
Click to expand it.
src/utils/getErrorMessage/getErrorMessage.constants.ts
+
1
−
0
View file @
cb1fe59a
...
...
@@ -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.
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment