aeat.core.telemetry._errors module

Telemetry-package error types.

Declared alongside the schema/consent/emit modules per the project’s error-taxonomy convention: every AeatError subclass binds to a registered ErrorCode row (core/errors/registry/_core.py).

See also

TelemetrySchemaError

Public telemetry schema failure exported by the package facade.

TELEMETRY_METRIC_REGISTRY

Closed metric allowlist whose integrity violations raise this error.

build_telemetry_payload()

Payload builder that enforces the registry before emission.

exception TelemetrySchemaError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: CoreError

Raised when a telemetry payload references an unregistered metric key.

This is a development/authoring-time integrity failure, not an operator- facing refusal: the metric-key registry (TELEMETRY_METRIC_REGISTRY) is the closed allowlist a telemetry producer must enroll in before it can emit a counter or timing. A key that is not registered for its command means a producer was added without registering its schema entry first — the exact gap no-dormant-source-resolvers’s closed-registry discipline exists to catch elsewhere in the codebase.

Parameters:
  • message (str | None)

  • context (dict[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]