Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ErrorMessage

A message class that wraps an execution error.

Notes

These are sent by the framework, and include extra detail about the error and when it occurred.

Hierarchy

  • Message
    • ErrorMessage

Index

Constructors

Properties

Methods

Constructors

constructor

  • new ErrorMessage(errorDetail: any, type: "init-error" | "render-error" | "option-error"): ErrorMessage
  • Parameters

    • errorDetail: any
    • type: "init-error" | "render-error" | "option-error"

    Returns ErrorMessage

Properties

errorDetail

errorDetail: any

isConflatable

isConflatable: boolean

Test whether the message is conflatable.

Notes

Message conflation is an advanced topic. Most message types will not make use of this feature.

If a conflatable message is posted to a handler while another conflatable message of the same type has already been posted to the handler, the conflate() method of the existing message will be invoked. If that method returns true, the new message will not be enqueued. This allows messages to be compressed, so that only a single instance of the message type is processed per cycle, no matter how many times messages of that type are posted.

Custom message types may reimplement this property.

The default implementation is always false.

type

type: string

The type of the message.

Notes

The type of a message should be related directly to its actual runtime type. This means that type can and will be used to cast the message to the relevant derived Message subtype.

Methods

conflate

  • conflate(other: Message): boolean
  • Conflate this message with another message of the same type.

    Parameters

    • other: Message

      A conflatable message of the same type.

    Returns boolean

    true if the message was successfully conflated, or false otherwise.

    Notes

    Message conflation is an advanced topic. Most message types will not make use of this feature.

    This method is called automatically by the message loop when the given message is posted to the handler paired with this message. This message will already be enqueued and conflatable, and the given message will have the same type and also be conflatable.

    This method should merge the state of the other message into this message as needed so that when this message is finally delivered to the handler, it receives the most up-to-date information.

    If this method returns true, it signals that the other message was successfully conflated and that message will not be enqueued.

    If this method returns false, the other message will be enqueued for normal delivery.

    Custom message types may reimplement this method.

    The default implementation always returns false.

Static IsErrorMsg

  • IsErrorMsg(msg: Message): msg is ErrorMessage
  • Parameters

    • msg: Message

    Returns msg is ErrorMessage

Generated using TypeDoc