English · Java
Appearance
English · Java
Appearance
WebError class represents an unhandled exception thrown in the page. It is dispatched via the browserContext.onWebError() event.
// Log all uncaught errors to the terminal
context.onWebError(webError -> {
System.out.println("Uncaught exception: " + webError.error());
});
// Navigate to a page with an exception.
page.navigate("data:text/html,<script>throw new Error('Test')</script>");Unhandled error that was thrown.
Returns
stringReturns
ObjectThe page that produced this unhandled exception, if any.
Returns
null | Page