libtcspc.StopWithError

final class libtcspc.StopWithError(event_types, message_prefix)[source]

Bases: Node

Pass-through processor that ends the stream with an error on a configured event.

When an event matching one of event_types is received, processing ends with an error: a RuntimeError-equivalent is raised on the Python side, with message_prefix included in the message. Unlike Stop, the downstream is not flushed. All other events pass through unchanged.

Parameters:
  • event_types (Iterable[EventType]) – Event types that trigger error termination.

  • message_prefix (str or Param[str]) – String prepended to the raised exception’s message, typically describing the source of the error condition.

Notes

Events handled:

  • Events matching one of event_types: end processing with an error. The downstream is not flushed.

  • All other event types: pass through unchanged.

  • End of input: pass through.

See also

tcspc::stop_with_error()

The underlying C++ factory function.