python-wechaty
python-wechaty copied to clipboard
搜索好友时,如果账号异常就报错程序停止,但是我想让他跳过继续执行下面的程序
2021-04-13 10:19:18,740 - FriendShip - INFO - search() <<class 'abc.Friendship'>, None, 18873723027>
2021-04-13 10:19:18,906 - HostiePuppet - INFO - receive error info <{'code': 31, 'msg': 'user is not found by 18873723027'}>
Traceback (most recent call last):
File "/home/py-wechaty/main.py", line 15, in <module>
asyncio.run(main())
File "/usr/local/python39/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/python39/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/py-wechaty/main.py", line 12, in main
await bot.start()
File "/usr/local/python39/lib/python3.9/site-packages/wechaty/wechaty.py", line 419, in start
await self.puppet.start()
File "/usr/local/python39/lib/python3.9/site-packages/wechaty_puppet_hostie/puppet.py", line 891, in start
await self._listen_for_event()
File "/usr/local/python39/lib/python3.9/site-packages/wechaty_puppet_hostie/puppet.py", line 991, in _listen_for_event
payload = EventErrorPayload(**payload_data)
TypeError: __init__() got an unexpected keyword argument 'code'
Plase tell me:
- What type of token are you using ?
- The pypi version of your
python-wechaty? - your simple code to reproduce your issue
So that I can help you to fix your problem.
I think it's a program trick to solve it, eg try catch. If it's done, I will close this issue later.