Skip to content
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

添加好友的时候如果用户拒绝或者回复消息给自己,则程序崩溃,try,catch捕获不到异常 #2692

Open
aqpmzngldh opened this issue May 10, 2024 · 4 comments

Comments

@aqpmzngldh
Copy link

添加好友的时候如果用户拒绝或者回复消息给自己,则程序崩溃,try,catch捕获不到异常

收到好友申请:人事-小璐 - ?
13:12:28 ERR [Request] [tid:d24d919c], padlocal grpc request failed: 1, error: Error: 2 UNKNOWN: [tid:d24d919c] wechat bad request error

Copy link

dosubot bot commented May 10, 2024

The error you're encountering, "wechat bad request error," suggests an issue with the Wechaty SDK's handling of friend requests, particularly when a user rejects a request or sends a message to themselves. This error might not be caught by your try-catch block if it's thrown asynchronously, outside of the block's synchronous execution flow.

In the Wechaty SDK, errors like these are managed through the GErrorMixin, which ensures that any error emitted is converted to a GError before being emitted, allowing for consistent error handling across the SDK. The Friendship class in Wechaty provides methods and properties to manage friend requests, but specific actions like handling rejections or self-replies need to be implemented by the developer.

To better diagnose and resolve the issue, it would be helpful to know the exact line of code or function call that's causing the error. This could be related to the throwWechatifyError(this.constructor) line in the SDK, which is known to throw such errors.

For further analysis, simulating or reproducing the error in a controlled environment could provide more insights. This involves following steps to reproduce the behavior, examining the expected versus actual behavior, and looking at full output logs.

If you continue to face difficulties, consider reviewing the error handling and asynchronous code execution in your implementation, and ensure you're using the latest version of the Wechaty SDK, as updates may contain fixes for such issues.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@huan
Copy link
Member

huan commented May 11, 2024

@aqpmzngldh Did you listen to the error event from Wechaty?

If not, try:

wechaty.on('error', console.error)

@aqpmzngldh
Copy link
Author

@aqpmzngldh Did you listen to the error event from Wechaty?

If not, try:

wechaty.on('error', console.error)

ok

@aqpmzngldh
Copy link
Author

@aqpmzngldh Did you listen to the error event from Wechaty?

If not, try:

wechaty.on('error', console.error)

请问下,是不是这个puppet是不是已经弃用了呢,为什么我在https://wechaty.js.org/docs/puppet-services/paimon中点击领取token打不开界面

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

No branches or pull requests

2 participants