From 3369a712715d88ba81fffd60a3ec6677527035b9 Mon Sep 17 00:00:00 2001 From: counterweight Date: Sun, 21 Dec 2025 17:59:18 +0100 Subject: [PATCH] Improve availability error messages with date context - Added date to slot overlap error message - Added date to invalid time range error message - Makes errors more actionable for users --- backend/routes/availability.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/routes/availability.py b/backend/routes/availability.py index 1d74193..570c097 100644 --- a/backend/routes/availability.py +++ b/backend/routes/availability.py @@ -100,7 +100,7 @@ async def set_availability( if sorted_slots[i].end_time > sorted_slots[i + 1].start_time: raise HTTPException( status_code=400, - detail=f"Time slots overlap: {sorted_slots[i].end_time} > {sorted_slots[i + 1].start_time}", + detail=f"Time slots overlap on {request.date}: slot ending at {sorted_slots[i].end_time} overlaps with slot starting at {sorted_slots[i + 1].start_time}. Please ensure all time slots are non-overlapping.", ) # Validate each slot's end_time > start_time @@ -108,7 +108,7 @@ async def set_availability( if slot.end_time <= slot.start_time: raise HTTPException( status_code=400, - detail=f"Slot end time must be after start time: {slot.start_time} - {slot.end_time}", + detail=f"Invalid time slot on {request.date}: end time {slot.end_time} must be after start time {slot.start_time}. Please correct the time range.", ) # Delete existing availability for this date