Errors¶
Every failure mode in denckring is one of these. None of them is silent: each carries
a stable code, a human-readable message, and a detail() dict for a caller that
would rather not parse English out of the message.
denckring.core.errors.DenckringError ¶
Bases: Exception
Base class for every error the library raises.
code is a stable string rather than the class name, so renaming a class
does not break a client reading the JSON. to_dict is what an agentic
caller sees instead of a traceback.
denckring.core.errors.MissingCapability ¶
MissingCapability(
procedure_id: str, lang: str, capability: str
)
denckring.core.errors.InvalidParams ¶
InvalidParams(procedure_id: str, message: str)
Bases: DenckringError
denckring.core.errors.DuplicateProcedure ¶
DuplicateProcedure(procedure_id: str)
Bases: DenckringError
denckring.core.errors.UnknownDevice ¶
UnknownDevice(
device_id: str, available: list[str] | None = None
)
Bases: DenckringError
denckring.core.errors.UnsettablePhrase ¶
UnsettablePhrase(syllables: int, covered: list[int])
Bases: DenckringError
denckring.core.errors.InputTooLong ¶
InputTooLong(
procedure_id: str,
given: int,
limit: int,
unit: str = "letters",
)
Bases: DenckringError
A generator that searches refuses input it cannot search in reasonable time.
Raised rather than returning a poor result, so a caller learns the limit instead of silently receiving something the procedure could not really do.
unit names what was counted, and defaults to what every caller
counted when this was written. proteus_verse rearranges words, and
a message telling its caller it can rearrange nine letters would be
precisely and confidently wrong about the limit it just hit.
denckring.core.errors.NoCandidateWord ¶
NoCandidateWord(
procedure_id: str, reason: str | None = None
)
Bases: DenckringError
A generator that needs a real word refuses rather than returning none.
Raised rather than returning text with no candidate in it: silence there
would let a caller believe something had been produced when nothing was
available to produce it from. reason names what, specifically, offered
nothing — a lexicon swap for paragram, a source word for diastic and
mesostic — because "no candidate word" alone does not say what a caller
should do differently. Left unset, the message is paragram's original
one, the first and for a while the only caller.
LEXICON_DEFAULT
class-attribute
instance-attribute
¶
LEXICON_DEFAULT = "found no one-letter swap of any word into a word the lexicon knows. Try a different text, or check it instead of generating from it."
detail ¶
detail() -> dict[str, Any]
reason is in here, not only inside message.
The whole point of giving this error a reason was that an agentic caller
learns the true cause — a source word for diastic, a lexicon swap for
paragram — and a caller reading the JSON could reach it only by parsing
English out of message, which is the thing to_dict exists to avoid.
denckring.core.errors.UnknownFigure ¶
UnknownFigure(
figure_id: str, available: list[str] | None = None
)
Bases: DenckringError
denckring.core.errors.UnknownLevel ¶
UnknownLevel(
figure_id: str, level: str, available: list[str]
)
Bases: DenckringError
denckring.core.errors.DuplicatePack ¶
DuplicatePack(lang: str, first: str, second: str)
Bases: DenckringError