Node internal uncaughtException
See original GitHub issueDescribe the bug When i want to get body of response i get this error
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
immediate._onImmediate: Protocol error (Network.getResponseBody): No resource with given identifier found
at processImmediate (node:internal/timers:464:21)
at process.callbackTrampoline (node:internal/async_hooks:130:17) {
name: 'Error'
}
error Command failed with exit code 1.
To Reproduce
await page.on('response', async (r) => {
if (r.url().includes('hoteldetail/rooms/')) {
const text = await r.text();
log.info(r.url());
}
});
Expected behavior Get respone body as a text.
System information:
- OS: [e.g. Linux Ubuntu]
- Node.js version [e.g. 16.6]
- Apify SDK version [e.g. 2.0.7]
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Uncaught exceptions in Node.js | Joyee Cheung's Blog
In this post, I'll jot down some notes that I took when refactoring the uncaught exception handling routines in Node.js.
Read more >Node.js Process uncaughtException Event - GeeksforGeeks
The 'uncaughtException' is an event of class Process within the process module which is emitted when an uncaught JavaScript exception bubbles ...
Read more >Nodejs uncaughtException event not fired if exception ...
Nodejs uncaughtException event not fired if exception occurred inside express handler ; What happens if you move someInvalidFunc(); below the app ...
Read more >Process | Node.js v19.3.0 Documentation
The 'uncaughtException' event is emitted when an uncaught JavaScript exception ... In this example, an Error object is generated internally by process.
Read more >Uncaught errors in Node.js and the browser
This article looks into what happens with unhandled errors both in Node.js and in the browser.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Closing since this was most likely unrelated to the SDK.
@laster04 never throw inside EventListeners as they are synchronous and don’t await the listener callbacks. If you must, you can use a deferred to throw a promise from inside, you need a try/catch there https://github.com/pocesar/actor-facebook-scraper/blob/ac6229408cb96bd46b19daa2164b4b6fb6286c4d/src/page.ts#L339-L353