clockblocks.exceptions

Exception hierarchy for clockblocks. Kept in a dependency-free module of its own so that any module (clock, utilities, scheduler, …) can import these at the top level without risking an import cycle — several of them reference each other’s errors but none of them should have to defer the import to function-call time.

Exceptions

ClockKilledError

Raised inside a forked clock's own thread when its wait is woken by kill(), so the fork wrapper can unwind the user function cleanly.

ClockblocksError

Base class for clockblocks errors.

DeadClockError

Raised when something tries to wait or fork on a clock that's no longer ALIVE (either killed already, or — for fork — still PENDING in its start_delay).

NoActiveClockError

Raised when a context-inferring clock operation (the module-level wait/fork/etc.) is attempted from a thread that has no clock active on it.

NotMasterClockError

Raised by operations that are only valid on the master (top-level) clock — e.g. run_as_server() — when called on a child clock.

SchedulerHeldError

Raised when wait() is called from a thread that is holding the scheduler via hold_scheduler() — most commonly inside a MIDI / OSC / HID callback, which runs under such a hold.

WrongThreadError

Raised when wait() is called from a thread that doesn't own the clock.