Skip to main content

ErrorEvent

The ErrorEvent class is the superclass for all events emitting an error. An error event is generated when Octo encounters an error.

Warning

It is not a good practice to create an event from this class directly, but should rather create one from one of the subclasses. This promotes a more accurate classification of events.

@example
const myEvent = new ErrorEvent(new Error('e'));
EventService.getInstance().emit(myEvent);
@returns

The Event instance.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new ErrorEvent(payload: Error, userData?: object): ErrorEvent
  • Parameters

    • payload: Error
    • userData: object = {}

    Returns ErrorEvent

Properties

readonlyheader

header: { timestamp: number }

Type declaration

  • timestamp: number

readonlypayload

payload: Error

readonlyuserData

userData: object

Methods

staticregistrar

  • registrar(...args: [EventService, PropertyDescriptor]): void
  • The registrar() method is explicitly called by the EventSource decorator for a method to enhance the method to auto-emit events.


    Parameters

    • rest...args: [EventService, PropertyDescriptor]

      Arguments are spread out using the array spread operator.

    Returns void