WebError
Added in: v1.38WebError class represents an unhandled exception thrown in the page. It is dispatched via the browserContext.onWebError() event.
java
// 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>");Methods
webError.error()
Added in: v1.38Unhandled error that was thrown.
Returns
string
webError.location()
Added in: v1.60Returns
Object
webError.page()
Added in: v1.38The page that produced this unhandled exception, if any.
Returns
null | Page