cleverly.CleverlyError#
- exception cleverly.CleverlyError(condition: str | None = None, /, *, reason: RefusalReason | None = None, alternative: str | None = None, roadmap: str | None = None, refusal: Refusal | None = None)[source]#
Base class for every error raised by cleverly.
Every error carries a
Refusalunderrefusal. A subclass declares the code its errors take by default indefault_reason. A subclass with no default requiresreason=at every raise.- Parameters:
- condition
strorNone The sentences that state the failed condition. Leave it out when
refusalis given.- reason
RefusalReasonorNone The reason code.
Nonetakes the class’sdefault_reason.- alternative
strorNone The sentence that names a working call.
- roadmap
strorNone The
docs/roadmap.mdid that tracks a missing capability.- refusal
RefusalorNone A complete record, as a capability row stores it.
- condition
- Raises:
TypeErrorWhen
refusalis given together with any other argument, or when no reason code is given and the class declares no default.