This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v1-10-test by this push:
new b5aa391 Show Generic Error for Charts & Query View in old UI (#12495)
b5aa391 is described below
commit b5aa39106c19c9ffe8fcce360dbab0f258be4377
Author: Kaxil Naik <[email protected]>
AuthorDate: Fri Nov 20 13:31:10 2020 +0000
Show Generic Error for Charts & Query View in old UI (#12495)
---
airflow/www/views.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/airflow/www/views.py b/airflow/www/views.py
index fdb674d..f11fb84 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -471,8 +471,9 @@ class Airflow(AirflowViewMixin, BaseView):
df = hook.get_pandas_df(
wwwutils.limit_sql(sql, CHART_LIMIT, conn_type=db.conn_type))
df = df.fillna(0)
- except Exception as e:
- payload['error'] += "SQL execution failed. Details: " + str(e)
+ except Exception:
+ log.exception("Chart SQL execution failed")
+ payload['error'] += "SQL execution failed. Contact your System
Administrator for more details"
if csv:
return Response(
@@ -2398,8 +2399,9 @@ class QueryView(wwwutils.DataProfilingMixin,
AirflowViewMixin, BaseView):
index=False,
na_rep='',
) if has_data else ''
- except Exception as e:
- flash(str(e), 'error')
+ except Exception:
+ log.exception("Query SQL execution failed")
+ flash("SQL execution failed. Contact your System Administrator
for more details", "error")
error = True
if has_data and len(df) == QUERY_LIMIT: