diff --git a/superset/config.py b/superset/config.py index f934e3adedf..2c40c0100df 100644 --- a/superset/config.py +++ b/superset/config.py @@ -325,6 +325,10 @@ if not CACHE_DEFAULT_TIMEOUT: # permission management SILENCE_FAB = True +# The link to a page containing common errors and their resolutions +# It will be appended at the bottom of sql_lab errors. +TROUBLESHOOTING_LINK = "" + # Integrate external Blueprints to the app by passing them to your # configuration. These blueprints will get integrated in the app diff --git a/superset/sql_lab.py b/superset/sql_lab.py index aeb71f6b79a..9e885784ebc 100644 --- a/superset/sql_lab.py +++ b/superset/sql_lab.py @@ -118,6 +118,10 @@ def execute_sql( def handle_error(msg): """Local method handling error while processing the SQL""" + troubleshooting_link = config["TROUBLESHOOTING_LINK"] + msg = "Error: {}. You can find common superset errors and their \ + resolutions at: {}".format(msg, troubleshooting_link) \ + if troubleshooting_link else msg query.error_message = msg query.status = QueryStatus.FAILED query.tmp_table_name = None