feat: Implement centralized error capture and handling with new middleware, services, and API endpoints, and add new admin and statistics API views.

This commit is contained in:
pacnpal
2026-01-02 15:55:42 -05:00
parent 1adba1b804
commit 95700c7d7b
43 changed files with 2477 additions and 158 deletions

View File

@@ -11,6 +11,7 @@ from django.core.cache import cache
from django.db import transaction
from ..models import ParkLocation
from apps.core.utils import capture_and_log
logger = logging.getLogger(__name__)
@@ -90,7 +91,7 @@ class ParkLocationService:
return result_data
except requests.RequestException as e:
logger.error(f"Error searching park locations: {str(e)}")
capture_and_log(e, 'Search park locations', source='service')
return {
"count": 0,
"results": [],
@@ -156,7 +157,7 @@ class ParkLocationService:
return result
except requests.RequestException as e:
logger.error(f"Error reverse geocoding park location: {str(e)}")
capture_and_log(e, 'Reverse geocode park location', source='service')
return {"error": "Reverse geocoding service temporarily unavailable"}
@classmethod