Package com.microsoft.playwright
Interface WebError
-
- All Known Implementing Classes:
WebErrorImpl
public interface WebErrorWebErrorclass represents an unhandled exception thrown in the page. It is dispatched via theBrowserContext.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>");
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Stringerror()Unhandled error that was thrown.Pagepage()The page that produced this unhandled exception, if any.
-
-
-
Method Detail
-
page
Page page()
The page that produced this unhandled exception, if any.- Since:
- v1.38
-
error
java.lang.String error()
Unhandled error that was thrown.- Since:
- v1.38
-
-