Skip to content

Exceptions

Every failure mode is a typed exception with readonly fields or getters — generated from ReflectionClass over every @api type in src/, not transcribed from prose. The README mentions these by name; this page is the field-by-field reference.

ExceptionThrown whenFields / getters
PropertyViolationExceptionA random or example run falsifies the property.getCounterExample(): CounterExample
RegressionViolationExceptionA replayed values entry from the regression corpus still fails.getArguments(): array, getSeed(): int
ExampleViolationExceptionAn explicit example fails. Reported verbatim — never shrunk.getIndex(): int (position in the examples list), getArguments(): array
GaveUpExceptionDiscarded attempts (Assume::that()) exceed maxDiscards before runs successful checks complete.$propertyName: string, $requiredRuns: int, $successfulRuns: int, $discardedRuns: int, $attempts: int, $maxDiscards: int
DeadlineExceededExceptionA single run exceeds timeoutMs. Reported as-is — not shrunk.$propertyName: string, $arguments: array, $elapsedMs: float, $timeoutMs: int
TimeBudgetExceededExceptionThe whole random phase exceeds budgetMs before runs successful checks complete.$propertyName: string, $budgetMs: int, $elapsedMs: float, $successfulRuns: int, $requiredRuns: int
GenerationExhaustedGen::filter() rejects 100 candidates in a row, or a sized collection (uniqueArrayOf/dictOf/commands) cannot reach its $min within its attempt budget.$arbitrary: string, $attempts: int
CoverageViolationExceptionClassify::cover() requirement not met — even though every run passed.Marker exception, no extra fields.
PostconditionViolationA Command::postCondition() returns false (or throws) during StateMachine::check().$trace: array, $step: int, $command: Command, $model: mixed, $result: mixed

Not part of the contract

AssumptionSkipped is a public class in the package's root namespace, but it carries no@api tag: it's the internal control-flow signal Assume::that(false) throws to abort the current attempt, caught by the interceptor before it ever reaches your test. Don't catch it, and don't build on it — a future release is free to change how discards are signalled internally.

Generated from a reflection pass over every @api type in src/ (docs/scripts/reflect-api.php) — see API overview for how this stays in sync with the source.