mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Decode error messages before trying to use them.
This commit is contained in:
parent
5f2a15dd6d
commit
6cb9ece6fd
@ -788,15 +788,15 @@ class ServerNode(PGChildNodeView):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not status:
|
if not status:
|
||||||
|
if hasattr(str, 'decode'):
|
||||||
|
errmsg = errmsg.decode('utf-8')
|
||||||
|
|
||||||
current_app.logger.error(
|
current_app.logger.error(
|
||||||
"Could not connected to server(#{0}) - '{1}'.\nError: {2}".format(
|
"Could not connected to server(#{0}) - '{1}'.\nError: {2}".format(
|
||||||
server.id, server.name, errmsg
|
server.id, server.name, errmsg
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if hasattr(str, 'decode'):
|
|
||||||
errmsg = errmsg.decode('utf-8')
|
|
||||||
|
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
success=0,
|
success=0,
|
||||||
status=401,
|
status=401,
|
||||||
|
Loading…
Reference in New Issue
Block a user