DamianPendrak commented on PR #34674:
URL: https://github.com/apache/superset/pull/34674#issuecomment-3191248501

   @sadpandajoe My idea was to separate them based on the regex. But now I see 
that it might be an issue if there is the same error message from different 
databases, and you can't separate them using regex. I pushed an update with a 
changed structure of the `CUSTOM_DATABASE_ERRORS` so we can separate them by 
database engine names, and apply them accordingly:
   ```Python
   CUSTOM_DATABASE_ERRORS = {
     "trino": {
       re.compile(r"TrinoUserError"): (
           "Custom error message",
           SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
           {
               "custom_doc_links": [
                   {
                       "url": "https://example.com/docs";,
                       "label": "Check documentation"
                   },
               ],
           }
       ),
     },
     "postgres": {}
   }
   ```
   
   About the original error - there is a similar way to overwrite the error 
messages in the db engine file in `superset/db_engine_specs`. Currently, it 
only shows an issue code and a link to the documentation in a collapsed 
component. The original error might be useful, but then I think it should be 
available in both custom error messages (db_engine_specs file and 
`superset_config.py`)
   <img width="852" height="374" alt="Screenshot 2025-08-06 at 13 23 28" 
src="https://github.com/user-attachments/assets/a0f0c5bc-8376-45ee-ae26-c7eb6c7b1bc9";
 />
   
   


-- 
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