chore: bubble up more db error messages #21982
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Many small improvements to error handling:
requests
library to Superset exceptions for both Trino and Druid (both userequests
for communication, and has "clean" error messages that shouldn't contain sensitive info)BaseEngineSpec
was missingget_dbapi_mapped_exception
in many methods that potentially raised database-specific exceptions - these are added here + exception chaining as recommended here.AFTER
When trying to Explore a dataset that has an error, the toast now shows the error message:
Error messages are also surfaced in SQL Lab when fetching schemas/tables:
BEFORE
On Explore, a generic uninformative error was toasted:
In SQL Lab, previously the table error message wasn't always raised, and no error context was available for either schema or table error toasts:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION