villebro opened a new pull request, #21982: URL: https://github.com/apache/superset/pull/21982
### SUMMARY Many small improvements to error handling: - Map exceptions from the `requests` library to Superset exceptions for both Trino and Druid (both use `requests` for communication, and has "clean" error messages that shouldn't contain sensitive info) - In SQL Lab, both table and schema metadata requests only show a generic error message on failure; this adds the error message to provide additional context on what the error was. - In Explore, unexpected exceptions are not shown in the error toast. Similar to SQL Lab table and schema errors, this adds the sanitized error message to the Explore error toast if available. - `BaseEngineSpec` was missing `get_dbapi_mapped_exception` in many methods that potentially raised database-specific exceptions - these are added here + exception chaining as recommended [here](https://docs.python.org/3/tutorial/errors.html#exception-chaining). ### 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 <!--- Required! What steps can be taken to manually verify the changes? --> ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org