[Del] remove unnecessary try...catch

This commit is contained in:
vn.py 2019-06-25 10:37:40 +08:00
parent 0d1a536b23
commit af94e1e186

View File

@ -257,13 +257,10 @@ class RestClient(object):
)
request.response = response
status_code = response.status_code
if status_code // 100 == 2: # 2xx都算成功尽管交易所都用200
try:
jsonBody = response.json()
request.callback(jsonBody, request)
request.status = RequestStatus.success
except:
print("not json body from request, check body: ",response.text)
if status_code // 100 == 2: # 2xx codes are all successful
json_body = response.json()
request.callback(json_body, request)
request.status = RequestStatus.success
else:
request.status = RequestStatus.failed