mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Improve the Test Connection error message (#1175)
This commit is contained in:
parent
cbc70d3738
commit
49cefc8b00
@ -1422,9 +1422,10 @@ class Caravel(BaseCaravelView):
|
|||||||
engine = create_engine(uri, connect_args=connect_args)
|
engine = create_engine(uri, connect_args=connect_args)
|
||||||
engine.connect()
|
engine.connect()
|
||||||
return json.dumps(engine.table_names(), indent=4)
|
return json.dumps(engine.table_names(), indent=4)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
return Response(
|
return Response((
|
||||||
traceback.format_exc(),
|
"Connection failed!\n\n"
|
||||||
|
"The error message returned was:\n{}").format(e),
|
||||||
status=500,
|
status=500,
|
||||||
mimetype="application/json")
|
mimetype="application/json")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user