mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-02-06 01:45:14 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user