refactor(ban_service): extract _bans_by_country_load_data helper
Break up long function into focused helper. Load data logic separate from aggregation.
This commit is contained in:
@@ -22,6 +22,8 @@ if TYPE_CHECKING:
|
||||
|
||||
from starlette.responses import Response as StarletteResponse
|
||||
|
||||
from app.models.response import ErrorMetadata
|
||||
|
||||
import structlog
|
||||
from fastapi import FastAPI, HTTPException, Request, status
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
@@ -327,7 +329,7 @@ def _get_error_code(exc: Exception) -> str:
|
||||
return snake_case
|
||||
|
||||
|
||||
def _get_error_metadata(exc: Exception) -> dict[str, str | int | float | bool | None]:
|
||||
def _get_error_metadata(exc: Exception) -> ErrorMetadata:
|
||||
"""Get structured metadata from an exception.
|
||||
|
||||
Calls the exception's get_error_metadata() method if available.
|
||||
|
||||
Reference in New Issue
Block a user