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:
   
![image](https://user-images.githubusercontent.com/33317356/198996047-cac67b7d-6c47-4a97-b40a-64f1b64f4398.png)
   
   Error messages are also surfaced in SQL Lab when fetching schemas/tables:
   
![image](https://user-images.githubusercontent.com/33317356/198996100-c4ae72c9-ec14-4832-a115-c53b6948b8f5.png)
   
   ### BEFORE
   On Explore, a generic uninformative error was toasted:
   
![image](https://user-images.githubusercontent.com/33317356/198996145-8d9db079-1892-4c7e-9e50-b5c1bc6f71d8.png)
   
   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:
   
![image](https://user-images.githubusercontent.com/33317356/198996180-48d97dbd-1ea8-4a5c-bbc7-171abfb25191.png)
   
   ### 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

Reply via email to