Skip to main content

CommandFailedEvent

This event is emitted when a command fails, with nextStep when the command knows what the user runs next. A listener that returns a promise is awaited, so it can finish writing before the process exits.

@group

Events/Command

Hierarchy

  • CommandEvent<{ command: string; durationInMs: number; error: Error; nextStep?: string }>
    • CommandFailedEvent

Index

Constructors

Properties

Constructors

constructor

  • CommandFailedEvent(name?: string, payload?: { command: string; durationInMs: number; error: Error; nextStep?: string }): CommandFailedEvent
  • Parameters

    • optionalname: string

      The subject of the event, when the event type alone does not identify it.

    • optionalpayload: { command: string; durationInMs: number; error: Error; nextStep?: string }

      The event's data.

      • command: string
      • durationInMs: number
      • error: Error
      • optionalnextStep: string

    Returns CommandFailedEvent

Properties

readonlyinheritedheader

header: { sequence: number; timestamp: number }

When the event was created. sequence counts every event this process created, so it orders two events created in the same millisecond, and events a late listener receives replayed.


Type declaration

  • sequence: number
  • timestamp: number

readonlyinheritedname

name: string

The subject of the event, when the event type alone does not identify it - e.g. the class name on a registration event. Empty otherwise.

readonlyinheritedpayload

payload: { command: string; durationInMs: number; error: Error; nextStep?: string }

The event's data. Its shape is fixed by the event type.


Type declaration

  • command: string
  • durationInMs: number
  • error: Error
  • optionalnextStep?: string
Page Options