Error catalog¶
Public exceptions raised by RowGuard 0.6.0. Import from rowguard
(for example from rowguard import PlanningError).
Hierarchy¶
RowGuardError
├── ConfigurationError
│ └── PlanningError # also a ConfigurationError
├── QueryExecutionError
├── RowAdaptationError
├── RowValidationError
├── RejectHandlerError
│ ├── CallbackError
│ └── QuarantineError
├── RejectionThresholdError
└── ResultAssemblyError # internal consistency (rare)
Catching ConfigurationError also catches PlanningError.
Catching RejectHandlerError also catches CallbackError / QuarantineError.
Catalog¶
Exception |
When |
Notable attributes |
|---|---|---|
|
Invalid call shape (both/neither session & connection; both |
— |
|
Plan-time failures (missing source, invalid maps, pushdown errors) |
|
|
DB/driver failures; closed stream re-entry |
|
|
Pydantic failure under |
|
|
Adaptation failure under raise (or wrapped) |
|
|
Base for callback / quarantine handler failures |
— |
|
Callback raised or returned an invalid decision |
|
|
Quarantine provider write failed |
|
|
|
|
|
Inconsistent result about to be published (should be rare) |
— |
Examples¶
import rowguard
from rowguard import PlanningError, RowValidationError
try:
rowguard.select(session=session, table=users, model=UserRead)
except RowValidationError as exc:
print(exc.row_index, exc.validation_error)
except PlanningError as exc:
print(exc.stage, exc)
Under default on_reject="raise", the first invalid fetched row raises
RowValidationError. With default use_sqlrules=True, that row may never be
fetched—see SQLRules pushdown.
Stream lifecycle¶
Re-using a closed
StreamResult/AsyncStreamResultraisesQueryExecutionError.Prefer
with/async withso cursors close on break, cancel, or error.