Skip to content

Commit

Permalink
Merge pull request #117 from polyrabbit/master
Browse files Browse the repository at this point in the history
在调用语义分析接口出错的时候,微信有时不会返回errmsg字段
  • Loading branch information
messense committed Dec 20, 2015
2 parents d87ce13 + 0924002 commit b39ca4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wechatpy/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _handle_result(self, res, method=None, url=None,

if 'errcode' in result and result['errcode'] != 0:
errcode = result['errcode']
errmsg = result['errmsg']
errmsg = result.get('errmsg', errcode)
if errcode in (40001, 40014, 42001):
# access_token expired, fetch a new one and retry request
self.fetch_access_token()
Expand Down

0 comments on commit b39ca4f

Please sign in to comment.