Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer-Sharp exposes several different failure signals, and each belongs to a different layer. Catch exceptions from GoToAsync for navigation failures, subscribe to PageError for uncaught JavaScript exceptions, use Console for diagnostics, use Error for a crashed page, and combine RequestFailed with response-status checks for network and HTTP problems. A 404 or 503 is normally not a failed request event.

Start by identifying the layer that failed

The fastest way to diagnose Puppeteer-Sharp output is to classify the signal before deciding whether to retry, alert, or fix application code.

Signal Layer and trigger Record Typical response
GoToAsync exception Navigation operation; the main resource could not be loaded or navigation timed out Exception type and message, target URL, timeout and navigation options Validate the URL, connectivity and TLS; adjust timeout or retry when appropriate
PageError Uncaught exception thrown by page JavaScript Message and raw Error Inspect the site’s code or reproduce with the same browser context
Console Console API calls, warnings and page-error-related console output Console type and message text Use as context, not as proof that a request or page failed
Error Browser reports that the page crashed Crash error details and page identity Discard the page, capture diagnostics and create a fresh page
RequestFailed Network request lifecycle failure, such as a timeout Request URL and failure text Check DNS, TLS, proxy, blocking and resource-specific retries
Response with status 400+ Server returned an HTTP error response Status code, response URL and request context Handle as an application or upstream HTTP error; it is not equivalent to transport failure

Handle navigation failures separately

GoToAsync either throws or returns information about the main-resource response. A thrown call can indicate an invalid URL, SSL problem, timeout, unreachable host, nonresponsive server or another failure loading the main document. A successful return does not mean every subresource loaded successfully, so keep navigation handling separate from request-event logging.

try
{
    var response = await page.GoToAsync(
        "https://example.com",
        new NavigationOptions
        {
            WaitUntil = new[] { WaitUntilNavigation.Networkidle0 },
            Timeout = 60_000
        });

    if (response is not null && response.Status >= 400)
    {
        logger.LogWarning("Main document returned HTTP {Status}: {Url}",
            response.Status, response.Url);
    }
}
catch (Exception ex)
{
    logger.LogError(ex, "Navigation failed for {Url}", "https://example.com");
    // Decide whether this failure is safe to retry for your workload.
}

Inspect the returned response when one is available, because an HTTP error status can be delivered normally. Do not infer that a non-null response means a 2xx result.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Catch uncaught JavaScript with PageError

PageError is the event for an uncaught exception inside page code. Its event arguments expose Message and a raw Error value. Preserve both. The raw value can be a string, another object or null when page code throws a primitive, so code that assumes a conventional .NET exception or always-present stack trace can lose the most useful evidence.

page.PageError += (_, e) =>
{
    logger.LogError(
        "Uncaught page exception: {Message}; raw error: {Error}",
        e.Message,
        e.Error);
};

Log the page URL, route or job identifier alongside these fields in your application. The event tells you that page JavaScript escaped its normal handling; it does not by itself identify a failed HTTP request.

Use Console for context, not a fatal-error switch

Console reports calls such as console.log, warnings and errors. Puppeteer-Sharp also emits console messages associated with page errors or warnings. Consequently, a console event is evidence worth recording but is not automatically a failure requiring a retry. Filter or route messages by their console type and retain the text for troubleshooting.

page.Console += (_, e) =>
{
    logger.LogInformation("Browser console: {Message}", e.Message.Text);
};

For production telemetry, consider separate log levels for ordinary information, warnings and error-level console entries. Keep PageError as the authoritative signal for an uncaught exception.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Distinguish a crashed page from page code errors

The page Error event indicates that the browser page itself crashed. This is different from a JavaScript exception reported by PageError. A crash can leave the page unusable even when no application exception was emitted, so treat it as a lifecycle event: record the error, stop using that page, and create a replacement before continuing.

page.Error += (_, e) =>
{
    logger.LogError(e.Error, "Page crashed");
};

When a crash occurs during a capture or scrape, mark the operation as incomplete rather than treating a partially produced artifact as valid.

Understand RequestFailed and why it misses 404

RequestFailed is for a request that fails in the network lifecycle, such as a timeout. The request exposes failure text that can distinguish transport-level causes. Redirects are also important: one request finishes and another request is issued, so log each URL rather than assuming one navigation equals one request.

page.RequestFailed += (_, e) =>
{
    logger.LogWarning(
        "Request failed: {Url}; {Failure}",
        e.Request.Url,
        e.Request.FailureText);
};

An HTTP 404 or 503 is still a completed HTTP exchange. Upstream Puppeteer documents that such responses finish with the request lifecycle’s completed event rather than requestfailed. To detect them, inspect response status codes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
page.Response += (_, e) =>
{
    if (e.Response.Status >= 400)
    {
        logger.LogWarning(
            "HTTP error response: {Status} {Url}",
            e.Response.Status,
            e.Response.Url);
    }
};

Use both handlers: a DNS failure, connection reset or timeout can produce RequestFailed without a response, while an application-generated 404 produces a response and no request-failure event.

A complete diagnostic wiring pattern

The following combines the signals into one page-level setup. It is an illustrative pattern; event-argument members and logging overloads can vary by Puppeteer-Sharp package version, so verify them against the API package installed by your project.

page.Console += (_, e) =>
    logger.LogInformation("Browser console: {Message}", e.Message.Text);

page.PageError += (_, e) =>
    logger.LogError("Uncaught page exception: {Message}; raw error: {Error}",
        e.Message, e.Error);

page.Error += (_, e) =>
    logger.LogError(e.Error, "Page crashed");

page.RequestFailed += (_, e) =>
    logger.LogWarning("Request failed: {Url}; {Failure}",
        e.Request.Url, e.Request.FailureText);

page.Response += (_, e) =>
{
    if (e.Response.Status >= 400)
        logger.LogWarning("HTTP error response: {Status} {Url}",
            e.Response.Status, e.Response.Url);
};

Register handlers before navigation so early console, request and page-error events are not missed. Include a correlation ID in every log record when several pages or jobs run concurrently.

Diagnose common symptoms

“Navigation timed out”

  • Check whether the main URL is reachable outside the browser and whether DNS, proxy or TLS negotiation is failing.
  • Confirm that the selected WaitUntil condition matches the site. Pages that keep long-lived connections may never become network-idle.
  • Capture the thrown exception and the URL; do not expect RequestFailed to explain every navigation timeout.

“The page shows an error, but no RequestFailed event fired”

  • Inspect Response status values. The server may have returned a normal 404, 401, 403 or 503 response.
  • Inspect PageError and Console if the page rendered an application-level error after a successful HTTP response.

“A console error appears on every run”

  • Determine the console message type and text before treating it as fatal.
  • Check whether the same message is accompanied by PageError, a failed request or an HTTP error response.

“The raw page error is null or not an exception”

Keep the raw value as an object and serialize it defensively. JavaScript permits throwing primitives and arbitrary objects; only the documented message is guaranteed to be the human-readable part.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

“The page crashed”

Stop issuing operations to that page, log the crash, close or discard the page according to your lifecycle design, and retry with a new page only when the operation is idempotent. Reusing a crashed page can turn one failure into a sequence of misleading errors.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Version and maintenance considerations

Puppeteer-Sharp is a .NET port of the official Node.js Puppeteer API. Package variants, browser revisions and event-argument details can differ between releases. Pin the package version used by the application, consult its matching API documentation, and compile a small diagnostic harness after upgrades. In particular, verify the exact members for response status, console text, request failure text and page-error arguments rather than copying a pattern unchanged across versions.

Or skip the browser setup

If your goal is a reliable image or PDF rather than browser-event diagnostics, ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and response headers report the page verdict and billing status. It also offers an MCP server for AI agents with take_screenshot, get_page_info and capture_pdf.

See the ScreenshotNeo API documentation for all options. A cURL capture is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

You can use the same endpoint from Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Or Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Every plan includes the full feature set, including full-page and element capture, device and retina settings, PDF controls, custom CSS and JavaScript, waits, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, configurable caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage reporting and an OpenAPI specification. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Frequently Asked Questions

Should I retry every Puppeteer-Sharp error?

No. Retry only idempotent operations and classify the signal first: transient navigation or transport failures may be retryable, while deterministic JavaScript exceptions, HTTP 404 responses and page crashes require different handling.

Where should I attach diagnostic event handlers?

Attach them immediately after creating the page and before calling navigation, so early console, response and request events are captured.

Can a successful navigation still contain broken assets?

Yes. Navigation concerns the main resource. Subresource failures and HTTP error responses must be observed through request and response events.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.