RemoteException class
A protocol-agnostic description of an uncaught exception thrown in a page or worker. Dispatched via the exception event on Page and WebWorker.
Signature
export declare class RemoteException
Remarks
Unlike the deprecated pageerror event, RemoteException does not reconstruct a Node.js Error. When the protocol supports it (CDP), it exposes the live remote exception value through RemoteException.handle().
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the RemoteException class.
Example
page.on('exception', exception => {
console.log(exception.name(), exception.text());
console.log(exception.location());
});
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
The live remote exception value, if available. Remarks: Only available with CDP, when the browser reports a reference to the thrown value (objects and symbols) and Puppeteer can bind it to the worker, the main world of a frame or Puppeteer's own isolated world. It is
The handle is disposed automatically right after the Using the handle after an The handle is shared by all listeners of the event: calling | ||
|
The primary location where the exception occurred. Remarks: For runtime errors this is | ||
|
The name of the exception, for example Remarks: This is the Empty string if the thrown value is not an error, for example a primitive, a plain object or a symbol. Always | ||
|
The call frames on the stack at the time the exception was thrown, innermost first. Remarks: Empty for compilation and syntax errors. | ||
|
The text of the exception as rendered by the browser, for example Remarks: For errors this is |