GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Playwright for Java
  • Docs
  • API
  • Java
  • Node.js
  • Python
  • .NET
  • Community
  • Classes
  • APIRequestContext
  • APIResponse
  • Browser
  • BrowserContext
  • BrowserType

This view

  • Original page
  • New address

GeezerVison is showing playwright.dev — WebError | Playwright Java

This is unreleased documentation for Playwright Java Next version.
For up-to-date documentation, see the latest version (stable).
Version: Next

WebError class represents an unhandled exception thrown in the page. It is dispatched via the BrowserContext.onWebError(handler) 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>");

Methods​

error​

Added in: v1.38 webError.error

Unhandled error that was thrown.

Usage

WebError.error();

Returns

  • String#

location​

Added in: v1.60 webError.location

Usage

WebError.location();

Returns

  • Location#
    • url String

      URL of the resource.

    • line int

      0-based line number in the resource.

    • column int

      0-based column number in the resource.


page​

Added in: v1.38 webError.page

The page that produced this unhandled exception, if any.

Usage

WebError.page();

Returns

  • null | Page#
  • Methods
    • error
    • location
    • page
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.