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

GQL-87: Bug: Surface cmr errors for user readability #139

Merged
merged 8 commits into from
Oct 30, 2024
Merged

Conversation

mandyparson
Copy link
Contributor

Overview

What is the feature?

When a user tries to Save & Publish, occationaly an error will come back from CMR. Previously, every cmr error would return the same error message: 'An unknown error occurred. Please refer to the ID ${requestId} when contacting Earthdata Operations (support@earthdata.nasa.gov).' This ticket surfaces both the location of the error and the error message itself. It also preserves how error messages were handled previously.

What is the Solution?

Two things:

  1. Allow external errors to surface for users who get back cmr errors, not just developers.
  2. Correctly parse errors that contain a path so that mmt can make notifications with them

What areas of the application does this impact?

index.js under permissions
parseError.js

Testing

Reproduction steps

  • **Environment for testing: local
  • **Collection to test with: your own
  1. Create a local collection draft that is ready to publish. Ensure that it does publish then go back to edit.
  2. Under Aquisitional Information, create two ComposedOfs with the same shortName.
  3. If doing this in graphQL, you should see it return with this message: ""message": "Location: Platforms[0] > Instruments[0] > ComposedOf,Composed Of must be unique. This contains duplicates named [ATM]." In MMT, you should get two notifications pop up: one for Location and one for the error itself.

Attachments

GraphQL:
Screenshot 2024-10-28 at 10 22 01 AM

MMT:
Screenshot 2024-10-28 at 10 22 40 AM

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

src/permissions/index.js Outdated Show resolved Hide resolved
src/permissions/index.js Outdated Show resolved Hide resolved
src/utils/parseError.js Show resolved Hide resolved
src/permissions/index.js Outdated Show resolved Hide resolved
src/permissions/index.js Outdated Show resolved Hide resolved
src/permissions/__tests__/fallbackError.test.js Outdated Show resolved Hide resolved
@mandyparson mandyparson requested a review from macrouch October 28, 2024 21:24
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (97d7b85) to head (5d34b46).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #139   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          106       106           
  Lines         2400      2410   +10     
  Branches       269       273    +4     
=========================================
+ Hits          2400      2410   +10     

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

@mandyparson mandyparson merged commit 5ee0fb5 into main Oct 30, 2024
8 checks passed
@mandyparson mandyparson deleted the GQL-87 branch October 30, 2024 20:42
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.

3 participants