-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Update Client.js #2768
base: main
Are you sure you want to change the base?
Update Client.js #2768
Conversation
This change to solve the target closed issue when using puppeteer as headless
how adding a catch will solve the issue? |
I dont know, but without a catch, a lib crash when execute that code. |
Without this catch it crashes when logging out if you are using puppeteer headless. Because there isn't page to listen on it's events. So the solution is simply the try and catch |
@@ -754,7 +754,7 @@ class Client extends EventEmitter { | |||
} else { | |||
this.pupPage.on('response', async (res) => { | |||
if(res.ok() && res.url() === WhatsWebURL) { | |||
await webCache.persist(await res.text()); | |||
await webCache.persist(await res.text().catch(_=>_)).catch(_=>_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you using await you should use try catch
This change to solve the target closed issue when using puppeteer as headless
PR Details
Description
Related Issue
Motivation and Context
How Has This Been Tested
Types of changes
Checklist