-
Notifications
You must be signed in to change notification settings - Fork 14k
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
chore(native-filters): Ensure consistent error handling #24206
chore(native-filters): Ensure consistent error handling #24206
Conversation
f047200
to
96d717a
Compare
96d717a
to
319a4cc
Compare
319a4cc
to
fc3b0fe
Compare
Codecov Report
@@ Coverage Diff @@
## master #24206 +/- ##
==========================================
- Coverage 68.30% 68.19% -0.11%
==========================================
Files 1952 1957 +5
Lines 75432 75592 +160
Branches 8191 8221 +30
==========================================
+ Hits 51521 51553 +32
- Misses 21807 21932 +125
- Partials 2104 2107 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the commit @michael-s-molina. I left a couple of comments.
}); | ||
setError( | ||
error.message || error.error || t('Check configuration'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-s-molina do we not need to preserve this messaging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at getClientErrorObject
implementation, an error is always returned and it deals with the generic case as well. In my opinion it offers a more standard treatment to the exceptions.
getClientErrorObject(error).then(parsedError => { | ||
errorRef.current = parsedError.errors?.[0]; | ||
}); | ||
error.json().then(body => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the previous question.
Co-authored-by: Michael S. Molina <michael.s.molina@gmail.com> (cherry picked from commit 674da1b)
SUMMARY
This PR ensures that the native filter components adhere to the underlying
SupersetError
returned by the server and render them accordingly via theErrorMessageWithStackTrace
component (which now accepts a fallback component) which provides custom overrides.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI, added unit tests, and manual testing. Below are examples of the
ErrorMessageWithStackTrace
component using an Airbnb internal custom override when users don't have access to the underlying dataset.Before
After
ADDITIONAL INFORMATION