mud_server.services.policy.errors

Error contracts for canonical policy services.

This module defines the typed service-layer exception used across policy subsystems. API route adapters rely on this error shape to preserve stable status codes and machine-readable contract codes.

Exceptions

PolicyServiceError

Typed policy-service error carrying stable HTTP and contract metadata.

Module Contents

exception mud_server.services.policy.errors.PolicyServiceError(*, status_code, code, detail)[source]

Bases: RuntimeError

Typed policy-service error carrying stable HTTP and contract metadata.

status_code

HTTP status code expected by API adapters.

code

Stable machine-readable error code used by clients/tests.

detail

Human-readable description for logs, operators, and UI surfaces.

Initialize self. See help(type(self)) for accurate signature.

status_code
code
detail
to_response_payload()[source]

Return canonical API payload shape for policy errors.