luplo.core.errors

Domain error hierarchy — one module for every caller-facing exception.

Every error carries an http_status hint so the FastAPI layer can translate them with one mapping. CLI/MCP layers turn them into exit codes or text responses.

Sibling modules (e.g. item_types, tasks, qa) import the bases from here and raise specific subclasses, so callers can except errors.LuploDomainError once and catch them all.

Exceptions

LuploDomainError

Base class for all luplo domain errors. Carries an HTTP status hint.

NotFoundError

Base class for all luplo domain errors. Carries an HTTP status hint.

ConflictError

Base class for all luplo domain errors. Carries an HTTP status hint.

ValidationError

Base class for all luplo domain errors. Carries an HTTP status hint.

AuthError

Base class for all luplo domain errors. Carries an HTTP status hint.

UnknownItemTypeError

Raised when create_item references an item_type not in the registry.

ContextValidationError

Raised when items.context fails its registered JSON Schema.

TaskNotFoundError

Base class for all luplo domain errors. Carries an HTTP status hint.

TaskAlreadyInProgressError

Base class for all luplo domain errors. Carries an HTTP status hint.

TaskStateTransitionError

Base class for all luplo domain errors. Carries an HTTP status hint.

QACheckNotFoundError

Base class for all luplo domain errors. Carries an HTTP status hint.

QAStateTransitionError

Base class for all luplo domain errors. Carries an HTTP status hint.

GlossaryGroupHasActiveTermsError

Raised when removing a canonical term while alias terms remain.

WorkUnitHasActiveTasksError

Base class for all luplo domain errors. Carries an HTTP status hint.

IdTooShortError

Raised when a UUID prefix is shorter than the minimum length.

InvalidIdFormatError

Raised when an ID is neither a full UUID nor a valid hex prefix.

AmbiguousIdError

Raised when a UUID prefix matches more than one row.

Module Contents

exception luplo.core.errors.LuploDomainError(message: str)

Bases: Exception

Base class for all luplo domain errors. Carries an HTTP status hint.

http_status: int = 400
message
exception luplo.core.errors.NotFoundError(message: str)

Bases: LuploDomainError

Base class for all luplo domain errors. Carries an HTTP status hint.

http_status: int = 404
exception luplo.core.errors.ConflictError(message: str)

Bases: LuploDomainError

Base class for all luplo domain errors. Carries an HTTP status hint.

http_status: int = 409
exception luplo.core.errors.ValidationError(message: str)

Bases: LuploDomainError

Base class for all luplo domain errors. Carries an HTTP status hint.

http_status: int = 400
exception luplo.core.errors.AuthError(message: str)

Bases: LuploDomainError

Base class for all luplo domain errors. Carries an HTTP status hint.

http_status: int = 401
exception luplo.core.errors.UnknownItemTypeError(item_type: str)

Bases: ValidationError

Raised when create_item references an item_type not in the registry.

item_type
exception luplo.core.errors.ContextValidationError(item_type: str, message: str)

Bases: ValidationError

Raised when items.context fails its registered JSON Schema.

item_type
exception luplo.core.errors.TaskNotFoundError(task_id: str)

Bases: NotFoundError

Base class for all luplo domain errors. Carries an HTTP status hint.

task_id
exception luplo.core.errors.TaskAlreadyInProgressError(work_unit_id: str, task_id: str)

Bases: ConflictError

Base class for all luplo domain errors. Carries an HTTP status hint.

work_unit_id
in_progress_task_id
exception luplo.core.errors.TaskStateTransitionError(task_id: str, from_status: str, to_status: str)

Bases: ConflictError

Base class for all luplo domain errors. Carries an HTTP status hint.

task_id
from_status
to_status
exception luplo.core.errors.QACheckNotFoundError(qa_id: str)

Bases: NotFoundError

Base class for all luplo domain errors. Carries an HTTP status hint.

qa_id
exception luplo.core.errors.QAStateTransitionError(qa_id: str, from_status: str, to_status: str)

Bases: ConflictError

Base class for all luplo domain errors. Carries an HTTP status hint.

qa_id
from_status
to_status
exception luplo.core.errors.GlossaryGroupHasActiveTermsError(group_id: str, term_id: str)

Bases: ConflictError

Raised when removing a canonical term while alias terms remain.

Cascade-delete (option B) only fires when the canonical is the last active term in the group. If aliases remain the caller must promote one to canonical or remove them first.

group_id
term_id
exception luplo.core.errors.WorkUnitHasActiveTasksError(work_unit_id: str, in_progress_task_id: str)

Bases: ConflictError

Base class for all luplo domain errors. Carries an HTTP status hint.

work_unit_id
in_progress_task_id
exception luplo.core.errors.IdTooShortError(prefix: str, min_length: int)

Bases: ValidationError

Raised when a UUID prefix is shorter than the minimum length.

prefix
min_length
exception luplo.core.errors.InvalidIdFormatError(value: str)

Bases: ValidationError

Raised when an ID is neither a full UUID nor a valid hex prefix.

value
exception luplo.core.errors.AmbiguousIdError(prefix: str, matches: list[tuple[str, str]])

Bases: ConflictError

Raised when a UUID prefix matches more than one row.

Carries up to two sample matches so callers can show the user enough to disambiguate without leaking the entire result set.

prefix
matches