* add full error with more detail (#479) * Preparing version 1.10.0 Snap (#478) (#487) * update to OrcaSQL ESRP Code Sign * code sign for non-windows * remove pr trigger for snap * remove trigger * update date esrp key for linux
This commit is contained in:
Родитель
314db93aba
Коммит
d15e57687f
|
@ -297,14 +297,14 @@ class PostgreSQLConnection(ServerConnection):
|
|||
"""
|
||||
Get the message from DatabaseError instance
|
||||
"""
|
||||
# If error.diag.message_primary is not None, return it.
|
||||
if error.diag and error.diag.message_primary:
|
||||
return error.diag.message_primary
|
||||
|
||||
# If error.args exists and has at least one element, return the first element as the error message.
|
||||
elif hasattr(error, 'args') and error.args and len(error.args) > 0:
|
||||
if hasattr(error, 'args') and error.args and len(error.args) > 0:
|
||||
return error.args[0]
|
||||
|
||||
# If error.diag.message_primary is not None, return it.
|
||||
elif error.diag and error.diag.message_primary:
|
||||
return error.diag.message_primary
|
||||
|
||||
# If neither is available, return a generic error message.
|
||||
else:
|
||||
return "An unspecified database error occurred."
|
||||
|
|
Загрузка…
Ссылка в новой задаче