Skip to content

Commit

Permalink
Improve the Test Connection error message (#1175)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored and bkyryliuk committed Sep 22, 2016
1 parent cbc70d3 commit 49cefc8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 49cefc8

Please sign in to comment.