Skip to content

Commit

Permalink
Add support of another DatabaseError format (#4019)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmigo authored and mistercrunch committed Dec 7, 2017
1 parent e98a1c3 commit e02d35e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,13 @@ def extract_error_message(cls, e):
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
Expand Down

0 comments on commit e02d35e

Please sign in to comment.