superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Add support of another DatabaseError format (#4019)
Date Thu, 07 Dec 2017 05:49:12 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e02d35e  Add support of another DatabaseError format (#4019)
e02d35e is described below

commit e02d35ed5c4b790e6a50cd24aaf2605984a884ae
Author: Dmitry Goryunov <d.f.goryunov@gmail.com>
AuthorDate: Thu Dec 7 06:49:03 2017 +0100

    Add support of another DatabaseError format (#4019)
---
 superset/db_engine_specs.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 51fa055..6700105 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -615,6 +615,13 @@ class PrestoEngineSpec(BaseEngineSpec):
                 error_dict.get('errorLocation'),
                 error_dict.get('message'),
             )
+        if (
+                type(e).__name__ == 'DatabaseError' and
+                hasattr(e, 'args') and
+                len(e.args) > 0
+        ):
+            error_dict = e.args[0]
+            return error_dict.get('message')
         return utils.error_msg_from_exception(e)
 
     @classmethod

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message