Decode error messages before trying to use them.

pull/3/head
Dave Page 2017-03-24 14:11:31 +00:00
parent 5f2a15dd6d
commit 6cb9ece6fd
1 changed files with 3 additions and 3 deletions

View File

@ -788,15 +788,15 @@ class ServerNode(PGChildNodeView):
)
if not status:
if hasattr(str, 'decode'):
errmsg = errmsg.decode('utf-8')
current_app.logger.error(
"Could not connected to server(#{0}) - '{1}'.\nError: {2}".format(
server.id, server.name, errmsg
)
)
if hasattr(str, 'decode'):
errmsg = errmsg.decode('utf-8')
return make_json_response(
success=0,
status=401,