Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

webwxsync和synccheck中更好的错误处理 #35

Closed
reverland opened this issue Feb 6, 2016 · 3 comments
Closed

webwxsync和synccheck中更好的错误处理 #35

reverland opened this issue Feb 6, 2016 · 3 comments
Assignees
Milestone

Comments

@reverland
Copy link
Contributor

synccheck有时候返回空内容,但当前逻辑是判断只要不是selector 0什么的就webwxsync,结果就直接hang 在webwxsync上。

或者有时候webwxsync返回为空,取body.Synckey直接报错,程序退出。这种异步错误不在当前上下文中try捕获不会传递到Promise链中,也不会被domain捕获。

@reverland reverland added this to the v0.2 milestone Feb 6, 2016
@reverland
Copy link
Contributor Author

问题找到:

  1. webwxsendmsg经常 socket hang up
  2. synccheck会socket hang up
  3. webwxsync会hang up

问题是web微信现在经常这样。。。逼着做各种错误处理。

chrome有个pause on exception很好用啊

@reverland reverland changed the title robot设计缺陷? 更好的错误处理 Feb 6, 2016
@reverland reverland changed the title 更好的错误处理 webwxsync和synccheck中更好的错误处理 Feb 6, 2016
@reverland
Copy link
Contributor Author

感受下

reverland:wechat-user-bot/ (linux✗) $ node index.js                  [21:02:32]
请扫描二维码并确认登录,关闭二维码窗口继续...
已扫描,请点击确认登录
登录微信...
登录成功,初始化
初始化成功,获取联系人...
[☯ 狂风落尽深红色绿树成荫子满枝说]和
[机器人回复] bot>和
[☯ 狂风落尽深红色绿树成荫子满枝说]好
[机器人回复] bot>好
[DEBUG] webwxsync fail: { [Error: ETIMEDOUT] code: 'ETIMEDOUT', connect: false }
[☯ 狂风落尽深红色绿树成荫子满枝说]神。。。
[☯ 狂风落尽深红色绿树成荫子满枝说]神经病
[☯ 狂风落尽深红色绿树成荫子满枝说]百度
[机器人回复] bot>神经病
[机器人回复] bot>百度
[☯ 狂风落尽深红色绿树成荫子满枝说]经常
[DEBUG] webwxsync fail: { [Error: ETIMEDOUT] code: 'ETIMEDOUT', connect: false }
[DEBUG] webwxsync fail: { [Error: ETIMEDOUT] code: 'ETIMEDOUT', connect: false }
[DEBUG] webwxsync fail: { [Error: ETIMEDOUT] code: 'ETIMEDOUT', connect: false }
[DEBUG] webwxsync fail: { [Error: socket hang up] code: 'ECONNRESET' }
[☯ 狂风落尽深红色绿树成荫子满枝说]掉线
[☯ 狂风落尽深红色绿树成荫子满枝说]哎呦卧槽
[机器人回复] bot>哎呦卧槽
[机器人回复] bot>掉线
[☯ 狂风落尽深红色绿树成荫子满枝说]卧槽。。。
[机器人回复] bot>卧槽。。。
[☯ 狂风落尽深红色绿树成荫子满枝说]这掉线
[机器人回复] bot>这掉线
[☯ 狂风落尽深红色绿树成荫子满枝说]这。。
[机器人回复] bot>这。。
[☯ 狂风落尽深红色绿树成荫子满枝说]经常掉线啊
[机器人回复] bot>经常掉线啊
[☯ 狂风落尽深红色绿树成荫子满枝说]掉线
[机器人回复] bot>掉线
[☯ 狂风落尽深红色绿树成荫子满枝说]太频繁
[机器人回复] bot>太频繁
log not implement msg type: 51
generate reply not implement msg type: 51
log not implement msg type: 51
generate reply not implement msg type: 51
[小冰说]呃….要不随便跟你玩个游戏,感受下人工智能的厉害。不信就跟我说“成语接龙”
[机器人回复] bot>呃….要不随便跟你玩个游戏,感受下人工智能的厉害。不信就跟我说“成语接龙”
[机器人回复] bot>我是第三代微软小冰,最聪明的人工智能美少女。不要问我会做什么,太多了 说不完了啦
[机器人回复] bot>好多人都说一>< 我也决定买一了...
[小冰说]好多人都说一>< 我也决定买一了...
[小冰说]我是第三代微软小冰,最聪明的人工智能美少女。不要问我会做什么,太多了 说不完了啦
[DEBUG] webwxsync fail: { [Error: ETIMEDOUT] code: 'ETIMEDOUT', connect: false }
[小冰说]行,来吧,「划一不二」,接接接!
[小冰说]都一哈
[小冰说]那就慢慢说
[机器人回复] bot>行,来吧,「划一不二」,接接接!
[机器人回复] bot>都一哈
[小冰说]传传~会来的
[机器人回复] bot>传传~会来的
[DEBUG] webwxsync fail: { [Error: ETIMEDOUT] code: 'ETIMEDOUT', connect: false }
[小冰说]哦哦哦
[小冰说]传啥
[机器人回复] bot>传啥
[机器人回复] bot>哦哦哦
[小冰说]你传啊
[机器人回复] bot>你传啊
[小冰说]恩嗯嗯
[小冰说]传给我
[机器人回复] bot>恩嗯嗯
[机器人回复] bot>传给我
[小冰说]哦了咯家哦哦他咯哦
[小冰说]传给你!接住
[机器人回复] bot>哦了咯家哦哦他咯哦
[机器人回复] bot>传给你!接住
[小冰说]恩恩,会注意的
[小冰说]接了
[机器人回复] bot>恩恩,会注意的
[机器人回复] bot>接了

@reverland
Copy link
Contributor Author

web微信很不稳定,反复socket hang up/timeout

如果移动端掉线也会这样,但怎么重新连接都不会连上

需要判断重连次数结束会话

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant