WebError
Source URL: https://playwright.dev/docs/api/class-weberror
WebError | Playwright
섹션 제목: “WebError | Playwright”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 terminal context.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>');Methods
섹션 제목: “Methods”error
섹션 제목: “error”Added in: v1.38 webError.error
Unhandled error that was thrown.
Usage
webError.error();Returns
page
섹션 제목: “page”Added in: v1.38 webError.page
The page that produced this unhandled exception, if any.
Usage
webError.page();Returns