diff --git a/caravel/views.py b/caravel/views.py index d87c9ba8a6bbe..82015cb44b773 100755 --- a/caravel/views.py +++ b/caravel/views.py @@ -1422,9 +1422,10 @@ def testconn(self): engine = create_engine(uri, connect_args=connect_args) engine.connect() return json.dumps(engine.table_names(), indent=4) - except Exception: - return Response( - traceback.format_exc(), + except Exception as e: + return Response(( + "Connection failed!\n\n" + "The error message returned was:\n{}").format(e), status=500, mimetype="application/json")