Context object passed to ObserverErrorHandler when an observer callback throws.

Observer plumbing is a first-class engine primitive, not an afterthought; this record gives error handlers enough information to attribute the failure to a specific subscription path (per-node fire vs. per-commit fire vs. the initial-fire that happens at subscription time).

interface ObserverErrorContext {
    nodeId?: string;
    source:
        | "node-subscriber"
        | "commit-subscriber"
        | "subscribe-initial"
        | "subscribe-reads-initial"
        | "subscribe-reads"
        | "subscribe-reads-projection";
    time: number;
}

Properties

Properties

nodeId?: string

Node id when source is node-subscriber or subscribe-initial.

source:
    | "node-subscriber"
    | "commit-subscriber"
    | "subscribe-initial"
    | "subscribe-reads-initial"
    | "subscribe-reads"
    | "subscribe-reads-projection"

Where the error came from.

  • node-subscriber — Phase G per-node observer fire.
  • commit-subscriber — Phase H per-commit observer fire.
  • subscribe-initial — synchronous initial fire from Graph.subscribe.
  • subscribe-reads-initial — synchronous initial fire from Graph.subscribeReads (#701).
  • subscribe-reads — Phase G per-projection observer fire from Graph.subscribeReads (#701).
  • subscribe-reads-projection — projection closure threw during a Phase G re-run (#701); the registration is preserved and the recorded read-set is left intact, so the next commit will retry.
time: number

GraphTime at which the observer was invoked.