-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log instead of throw new Error when receiving unknown events #216
Comments
I'd like to accept a Pull Request to make it a soft log instead of a hard exception. |
Issue closed since PR has been merged. |
When I try to run npm install, an error occursl TypeError: Cannot use 'in' operator to search for 'port' in undefined |
me too |
你好 我也有这样的问题 |
怎么解决的? |
In current wechaty-puppet-service code, we throw an Error when receiving unknown grpc event:
puppet-service/src/client/puppet-service.ts
Line 356 in cbd2bc8
This error won't be caught by error listener and will break the system. If the bot has registered unhandled error listener on process, the puppet-service event listener will break and no futher events can be processed, which will result in system reset by watch dog. If there is no unhadled error lisener registered, the process will exit directly.
Thus we should change it by logging the error, or emit an error event. Since there might be new events in new versions of puppet and this will break the system for people using older versions.
The text was updated successfully, but these errors were encountered: