Backend: HTTPException + {"detail": "..."} Frontend: sonner toast on error
- •401 → redirect /login
- •403 → "No access to this task"
- •404 → "Task not found"
- •Validation → field errors
Make messages user-friendly.
后端抛出 HTTPException 异常,前端则以 Toast 提示或警示框形式予以响应。
--- frontmattername: Todo Error Handling & Feedback description: Backend HTTPException + frontend toast / alerts triggers: error, exception, toast, alert, 401, 403, 404, validation, fail
Backend: HTTPException + {"detail": "..."} Frontend: sonner toast on error
Make messages user-friendly.