Skip to content

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.

code class-attribute instance-attribute

code: str = ''

detail

detail() -> dict[str, Any]

Machine-readable specifics. Subclasses override; the base has none.

to_dict

to_dict() -> dict[str, Any]

denckring.core.errors.UnknownProcedure

UnknownProcedure(procedure_id: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_procedure'

procedure_id instance-attribute

procedure_id = procedure_id

suggestions instance-attribute

suggestions = _near(procedure_id)

detail

detail() -> dict[str, Any]

denckring.core.errors.UnknownLanguage

UnknownLanguage(lang: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_language'

lang instance-attribute

lang = lang

detail

detail() -> dict[str, Any]

denckring.core.errors.MissingCapability

MissingCapability(
    procedure_id: str, lang: str, capability: str
)

Bases: DenckringError

capability instance-attribute

capability = capability

code class-attribute instance-attribute

code = 'missing_capability'

lang instance-attribute

lang = lang

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.core.errors.InvalidParams

InvalidParams(procedure_id: str, message: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'invalid_params'

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.core.errors.DuplicateProcedure

DuplicateProcedure(procedure_id: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'duplicate_procedure'

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.core.errors.UnknownDevice

UnknownDevice(
    device_id: str, available: list[str] | None = None
)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_device'

device_id instance-attribute

device_id = device_id

detail

detail() -> dict[str, Any]

denckring.core.errors.UnsettablePhrase

UnsettablePhrase(syllables: int, covered: list[int])

Bases: DenckringError

code class-attribute instance-attribute

code = 'unsettable_phrase'

syllables instance-attribute

syllables = syllables

detail

detail() -> dict[str, Any]

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.

code class-attribute instance-attribute

code = 'input_too_long'

given instance-attribute

given = given

limit instance-attribute

limit = limit

procedure_id instance-attribute

procedure_id = procedure_id

unit instance-attribute

unit = unit

detail

detail() -> dict[str, Any]

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."

code class-attribute instance-attribute

code = 'no_candidate_word'

procedure_id instance-attribute

procedure_id = procedure_id

reason instance-attribute

reason = reason or self.LEXICON_DEFAULT

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.MalformedTable

MalformedTable(reason: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'malformed_table'

denckring.core.errors.MalformedCorpus

MalformedCorpus(reason: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'malformed_corpus'

denckring.core.errors.UnknownFigure

UnknownFigure(
    figure_id: str, available: list[str] | None = None
)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_figure'

figure_id instance-attribute

figure_id = figure_id

detail

detail() -> dict[str, Any]

denckring.core.errors.UnknownLevel

UnknownLevel(
    figure_id: str, level: str, available: list[str]
)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_level'

level instance-attribute

level = level

detail

detail() -> dict[str, Any]

denckring.core.errors.DuplicatePack

DuplicatePack(lang: str, first: str, second: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'duplicate_pack'

lang instance-attribute

lang = lang

detail

detail() -> dict[str, Any]