RemoteException
Namespace: PuppeteerSharp
public class RemoteExceptionA protocol-agnostic description of an uncaught exception thrown in a page or worker. Dispatched via the ExceptionThrown and ExceptionThrown events.
Inheritance: object
Unlike the PageError event, RemoteException does not reconstruct an error value. When the protocol supports it (CDP), it exposes the live remote exception value through Handle. Each call frame of StackTrace is reported as a ConsoleMessageLocation (URL, line number and column number).
Properties
Section titled “Properties”Handle
Section titled “Handle”public IJSHandle Handle { get; }Gets the live remote exception value, if available. null for thrown primitives other than
symbols, for exceptions thrown in other isolated worlds, and for exceptions thrown by code that
Puppeteer injected.
Value: IJSHandle
The handle is disposed automatically right after the event has been dispatched. To keep using it beyond the synchronous part of your handler, call Move() synchronously inside the handler and dispose of the handle yourself once you are done with it. The handle is shared by all handlers of the event.
Location
Section titled “Location”public ConsoleMessageLocation Location { get; }Gets the primary location where the exception occurred. For runtime errors this is the first element of StackTrace. For compilation and syntax errors (where StackTrace is empty), it falls back to the top-level coordinates reported for the exception.
Value: ConsoleMessageLocation
public string Name { get; }Gets the name of the exception, for example Error, TypeError, SyntaxError or AbortError.
Empty string if the thrown value is not an error, for example a primitive, a plain object or a symbol.
Value: string
StackTrace
Section titled “StackTrace”public IReadOnlyList<ConsoleMessageLocation> StackTrace { get; }Gets the call frames on the stack at the time the exception was thrown, innermost first. Empty for compilation and syntax errors.
Value: IReadOnlyList<ConsoleMessageLocation>
public string Text { get; }Gets the text of the exception as rendered by the browser, for example Error: boom.
For errors this is ${name}: ${message} (or just the name if the message is empty), without the stack.
For other thrown values it is their description, for example Object for a plain object.
Value: string
Made with love by Dario Kondratiuk