mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-02-05 16:35:18 -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:
@@ -6,6 +6,7 @@ Following Django styleguide pattern for business logic encapsulation.
|
||||
from django.contrib.auth.models import AbstractBaseUser
|
||||
from django.db import transaction
|
||||
|
||||
from apps.core.utils import capture_and_log
|
||||
from apps.rides.models import Ride
|
||||
|
||||
|
||||
@@ -191,14 +192,8 @@ class RideStatusService:
|
||||
ride.apply_post_closing_status()
|
||||
transitioned_rides.append(ride)
|
||||
except Exception as e:
|
||||
# Log error but continue processing other rides
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.error(
|
||||
f"Failed to process closing ride {ride.id}: {e}",
|
||||
exc_info=True,
|
||||
)
|
||||
# Capture error to dashboard but continue processing other rides
|
||||
capture_and_log(e, f'Process closing ride {ride.id}', source='service')
|
||||
continue
|
||||
|
||||
return transitioned_rides
|
||||
|
||||
Reference in New Issue
Block a user