WebError class represents an unhandled exception thrown in the page. It is dispatched via the browserContext.on('weberror') event.
// Log all uncaught errors to the terminalcontext.on('weberror', webError => { console.log(`Uncaught exception: "${webError.error()}"`);});// Navigate to a page with an exception.await page.goto('data:text/html,<script>throw new Error("Test")</script>'); Copy
// Log all uncaught errors to the terminalcontext.on('weberror', webError => { console.log(`Uncaught exception: "${webError.error()}"`);});// Navigate to a page with an exception.await page.goto('data:text/html,<script>throw new Error("Test")</script>');
Unhandled error that was thrown.
The page that produced this unhandled exception, if any.
Generated using TypeDoc
WebError class represents an unhandled exception thrown in the page. It is dispatched via the browserContext.on('weberror') event.