Skip to main content

WebError

WebError class represents an unhandled exception thrown in the page. It is dispatched via the BrowserContext.WebError event.

// Log all uncaught errors to the terminal
context.WebError += (_, webError) =>
{
Console.WriteLine("Uncaught exception: " + webError.Error);
};

Methods

Error

Added in: v1.38 webError.Error

Unhandled error that was thrown.

Usage

WebError.Error

Returns


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