qfa.domain.errors#

Domain error hierarchy for the feedback analysis backend.

Exceptions

AnalysisError

Non-recoverable error during feedback analysis.

AnalysisTimeoutError

Raised when an analysis exceeds the allowed deadline.

AuthenticationError

Raised when an API request cannot be authenticated.

AuthorizationError

Raised when a user lacks permission for the requested operation.

DomainError

Base error for all domain-level exceptions.

FeedbackTooLargeError(message, *, ...)

Raised when estimated tokens for the submitted feedback exceed the limit.

LLMError

Base error for LLM adapter failures.

LLMRateLimitError

Raised when the LLM provider returns a rate-limit response.

LLMTimeoutError

Raised when the LLM provider does not respond in time.

MissingCallScopeError

Raised when an LLM call is recorded without an active CallContext.

UsageRepositoryUnavailableError

Raised when a usage-repository read fails due to backend unavailability.

exception qfa.domain.errors.DomainError[source]#

Bases: Exception

Base error for all domain-level exceptions.

exception qfa.domain.errors.AnalysisError[source]#

Bases: DomainError

Non-recoverable error during feedback analysis.

exception qfa.domain.errors.AnalysisTimeoutError[source]#

Bases: AnalysisError

Raised when an analysis exceeds the allowed deadline.

exception qfa.domain.errors.FeedbackTooLargeError(message: str, *, estimated_tokens: int, limit: int)[source]#

Bases: AnalysisError

Raised when estimated tokens for the submitted feedback exceed the limit.

Variables:
  • estimated_tokens (int) – The estimated token count for the submitted feedback records.

  • limit (int) – The maximum allowed token count.

exception qfa.domain.errors.LLMError[source]#

Bases: DomainError

Base error for LLM adapter failures.

exception qfa.domain.errors.LLMTimeoutError[source]#

Bases: LLMError

Raised when the LLM provider does not respond in time.

exception qfa.domain.errors.LLMRateLimitError[source]#

Bases: LLMError

Raised when the LLM provider returns a rate-limit response.

exception qfa.domain.errors.AuthenticationError[source]#

Bases: DomainError

Raised when an API request cannot be authenticated.

exception qfa.domain.errors.AuthorizationError[source]#

Bases: DomainError

Raised when a user lacks permission for the requested operation.

exception qfa.domain.errors.MissingCallScopeError[source]#

Bases: RuntimeError

Raised when an LLM call is recorded without an active CallContext.

Indicates a wiring bug: the orchestrator forgot to enter a call_scope block before calling the LLM. Should never reach a user.

exception qfa.domain.errors.UsageRepositoryUnavailableError[source]#

Bases: DomainError

Raised when a usage-repository read fails due to backend unavailability.

Distinct from “feature disabled”: this signals that the repository is wired and the request hit the DB but the connection or query failed transiently (e.g. Postgres unreachable, pool exhausted, broker reset). The API surfaces this as 503 {"code": "usage_backend_unavailable"}, so consumers can distinguish it from usage_tracking_disabled and drive retry/backoff logic accordingly.