Skip to content

Commit

Permalink
b64 encoding the body in logging when failure happens
Browse files Browse the repository at this point in the history
  • Loading branch information
wjo1212 committed Jan 25, 2018
1 parent d88551b commit 6f98181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aliyun/log/logclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from .putlogsresponse import PutLogsResponse
from .shard_response import *
from .shipper_response import *
from .util import Util, parse_timestamp
from .util import Util, parse_timestamp, base64_encodestring as b64e
from .util import base64_encodestring as e64, base64_decodestring as d64
from .version import API_VERSION, USER_AGENT
import json
Expand Down Expand Up @@ -119,7 +119,7 @@ def _loadJson(resp_status, resp_header, resp_body, requestId):
return json.loads(resp_body)
except Exception as ex:
raise LogException('BadResponse',
'Bad json format:\n%s' % resp_body + '\n' + repr(ex),
'Bad json format:\n"%s"' % b64e(resp_body) + '\n' + repr(ex),
requestId, resp_status, resp_header, resp_body)

def _getHttpResponse(self, method, url, params, body, headers): # ensure method, url, body is str
Expand Down

0 comments on commit 6f98181

Please sign in to comment.