{"record":{"id":"9391a95aee9c14a7","repo":"HKUDS/DeepTutor","slug":"message-not-found","errorCode":null,"errorMessage":"Message not found","messagePattern":"Message not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"deeptutor/api/routers/sessions.py","lineNumber":202,"sourceCode":"        raise HTTPException(status_code=404, detail=\"Session not found\")\n    updated = await store.update_session_preferences(\n        session_id, {\"selected_branches\": dict(payload.selected_branches)}\n    )\n    if not updated:\n        raise HTTPException(status_code=404, detail=\"Session not found\")\n    return {\"selected_branches\": payload.selected_branches}\n\n\n@router.delete(\"/{session_id}/messages/{message_id}\")\nasync def delete_turn_by_message(session_id: str, message_id: int):\n    store = get_sqlite_session_store()\n    result = await store.delete_turn_by_message(session_id, message_id)\n    if result[\"was_running\"]:\n        raise HTTPException(\n            status_code=409, detail=\"Cannot delete a message while its turn is running\"\n        )\n    if not result[\"deleted\"]:\n        raise HTTPException(status_code=404, detail=\"Message not found\")\n    attachment_store = get_attachment_store()\n    for aid in result[\"attachment_ids\"]:\n        try:\n            await attachment_store.delete_attachment(session_id, aid)\n        except Exception:\n            logger.exception(\"failed to delete attachment %s for session %s\", aid, session_id)\n    return result\n\n\n@router.post(\"/{session_id}/quiz-results\")\nasync def record_quiz_results(session_id: str, payload: QuizResultsRequest):\n    if not payload.answers:\n        raise HTTPException(status_code=400, detail=\"Quiz results are required\")\n    store = get_sqlite_session_store()\n    session = await store.get_session(session_id)\n    if session is None:\n        raise HTTPException(status_code=404, detail=\"Session not found\")\n    content = _format_quiz_results_message(payload.answers)","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/sessions.py#L184-L220","documentation":"Error \"Message not found\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/sessions.py:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}