micahstubbs / screenshot-service

services to create a screenshot of a web page. optimized for screenshotting interactive data graphics.
0 stars 0 forks source link

handle puppeteer page crash #24

Open micahstubbs opened 5 years ago

micahstubbs commented 5 years ago
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]: (node:29770) UnhandledPromiseRejectionWarning: Error: Page crashed!
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at Page._onTargetCrashed (/home/ubuntu/screenshot-service/dedicated-server/node_modules/puppeteer/lib/Page.js:102:24)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at Session.Page.client.on.event (/home/ubuntu/screenshot-service/dedicated-server/node_modules/puppeteer/lib/Page.js:97:56)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at emitOne (events.js:116:13)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at Session.emit (events.js:211:7)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at Session._onMessage (/home/ubuntu/screenshot-service/dedicated-server/node_modules/puppeteer/lib/Connection.js:210:12)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at Connection._onMessage (/home/ubuntu/screenshot-service/dedicated-server/node_modules/puppeteer/lib/Connection.js:105:19)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at emitOne (events.js:116:13)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at WebSocket.emit (events.js:211:7)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at Receiver._receiver.onmessage (/home/ubuntu/screenshot-service/dedicated-server/node_modules/ws/lib/WebSocket.js:141:47)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]:     at Receiver.dataMessage (/home/ubuntu/screenshot-service/dedicated-server/node_modules/ws/lib/Receiver.js:389:14)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]: (node:29770) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Oct 31 19:22:17 screenshot-bot screenshot-bot[29770]: (node:29770) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
image ![screen shot 2018-10-31 at 12 22 25 pm](https://user-images.githubusercontent.com/2119400/47813295-df8efe00-dd07-11e8-85d3-798f09f562df.png)
micahstubbs commented 5 years ago

would like to fix the crash, or at least add a catch block to catch the error message