Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: refacto of error management #6663

Merged
merged 1 commit into from
Feb 22, 2024
Merged

front: refacto of error management #6663

merged 1 commit into from
Feb 22, 2024

Conversation

sim51
Copy link
Contributor

@sim51 sim51 commented Feb 16, 2024

See https://github.com/osrd-project/osrd-confidential/issues/281#issuecomment-1948412084 for more details

Follows the PR on the generation of I18N keys for API errors. This PR :

  • centralized the code where we cast error for notification
  • use i18n for name and message

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

Attention: 207 lines in your changes are missing coverage. Please review.

Comparison is base (906da79) 27.79% compared to head (07c6906) 27.87%.
Report is 8 commits behind head on dev.

Files Patch % Lines
front/src/utils/error.ts 46.87% 34 Missing ⚠️
...dules/project/components/AddOrEditProjectModal.tsx 0.00% 20 Missing ⚠️
front/src/reducers/osrdsimulation/simulation.ts 6.25% 15 Missing ⚠️
...c/modules/study/components/AddOrEditStudyModal.tsx 0.00% 13 Missing ⚠️
...ents/RollingStockEditor/RollingStockEditorForm.tsx 9.09% 10 Missing ⚠️
...src/applications/stdcm/views/StdcmRequestModal.tsx 0.00% 9 Missing ⚠️
...s/RollingStockEditor/RollingStockEditorButtons.tsx 0.00% 9 Missing ⚠️
front/src/reducers/editor/thunkActions.ts 0.00% 9 Missing ⚠️
...ra/components/InfraSelector/InfraSelectorModal.tsx 0.00% 8 Missing ⚠️
front/src/applications/editor/Editor.tsx 0.00% 7 Missing ⚠️
... and 19 more
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #6663      +/-   ##
============================================
+ Coverage     27.79%   27.87%   +0.08%     
  Complexity     2172     2172              
============================================
  Files          1043     1043              
  Lines        128732   128726       -6     
  Branches       2570     2569       -1     
============================================
+ Hits          35777    35882     +105     
+ Misses        91469    91359     -110     
+ Partials       1486     1485       -1     
Flag Coverage Δ
core 79.36% <ø> (+<0.01%) ⬆️
editoast 75.25% <ø> (-0.09%) ⬇️
front 8.40% <15.85%> (+0.06%) ⬆️
gateway 2.50% <ø> (ø)
railjson_generator 87.26% <ø> (+<0.01%) ⬆️
tests 81.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sim51 sim51 force-pushed the bsi/error-messages-front branch 3 times, most recently from fdf6a4b to 1cde71b Compare February 21, 2024 08:56
@sim51 sim51 marked this pull request as ready for review February 21, 2024 08:58
@sim51 sim51 requested a review from a team as a code owner February 21, 2024 08:58
@sim51 sim51 enabled auto-merge February 21, 2024 08:58
Copy link
Contributor

@nicolaswurtz nicolaswurtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good job, thx. It's clear & concise. A few comment although ;)

front/src/reducers/editor/thunkActions.ts Outdated Show resolved Hide resolved
Follows the PR on the generation of I18N keys for API errors.
This commit :
- centralized the code where we cast error for notification
- use i18n for name and message
Copy link
Contributor

@nicolaswurtz nicolaswurtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, thx!

@sim51 sim51 added this pull request to the merge queue Feb 22, 2024
Merged via the queue into dev with commit 940894e Feb 22, 2024
22 checks passed
@sim51 sim51 deleted the bsi/error-messages-front branch February 22, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants