ErrorEvent

Overview

ErrorEvent is a class in Aspose.Html FOSS for Python. Inherits from: Event.

Script error event (WHATWG HTML §8.1.3.6).

This class provides 5 methods for working with ErrorEvent objects in Python programs. Available methods include: __init__, init_event, prevent_default, stop_immediate_propagation, stop_propagation. All public members are accessible to any Python application after installing the Aspose.Html FOSS for Python package. Properties: bubbles, cancelable, colno, current_target, default_prevented, error, and 7 more.

Properties

NameTypeAccessDescription
messagestrReadHuman-readable error message.
filenamestrReadURL of the script where the error originated.
linenointReadLine number where the error occurred.
colnointReadColumn number where the error occurred.
error"object | None"ReadThe error object (always None in headless mode).
typestrReadThe event type string.
bubblesboolReadWhether the event bubbles.
cancelableboolReadWhether the default action can be prevented.
target"EventTarget | None"ReadThe EventTarget on which the event was dispatched.
current_target"EventTarget | None"ReadThe EventTarget whose listener is currently being invoked.
event_phaseintReadPhase constant: NONE (0), CAPTURING_PHASE (1), AT_TARGET (2), BUBBLING_PHASE (3).
default_preventedboolReadWhether preventDefault() was called on a cancelable event.
timestampfloatReadUnix epoch time (seconds) at Event creation.

Methods

SignatureDescription
__init__(type: str, bubbles: bool, cancelable: bool, message: str, filename: str, lineno: int, colno: int, error: object)Calls init(type, bubbles, cancelable, message, filename, lineno, colno, error) on this ErrorEvent instance.
prevent_default()Set default_prevented to True if the event is cancelable.
stop_propagation()Stop event propagation after all listeners on the current target finish.
stop_immediate_propagation()Stop propagation AND prevent remaining listeners on the current target.
init_event(type: str, bubbles: bool, cancelable: bool)Legacy alias for pre-dispatch event initialization.

See Also