{"record":{"id":"4c4d3c4a95306a71","repo":"HKUDS/DeepTutor","slug":"learning-capture-not-found","errorCode":null,"errorMessage":"Learning capture not found","messagePattern":"Learning capture not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"deeptutor/api/routers/book.py","lineNumber":413,"sourceCode":"        chapter_title=req.chapter_title or chapter_title,\n        user_note=req.user_note.strip(),\n        content_hash=content_hash,\n        status=status,\n    )\n    storage.upsert_learning_capture(capture)\n    return {\"capture\": _capture_payload(capture)}\n\n\n@router.patch(\"/books/{book_id}/learning-captures/{capture_id}\")\nasync def update_learning_capture(\n    book_id: str,\n    capture_id: str,\n    req: LearningCaptureUpdateRequest,\n) -> dict[str, Any]:\n    storage = get_book_storage()\n    capture = storage.load_learning_capture(book_id, capture_id)\n    if capture is None:\n        raise HTTPException(status_code=404, detail=\"Learning capture not found\")\n\n    requested_status = _coerce_capture_status(req.status) if req.status is not None else None\n    if requested_status is not None and not _is_capture_transition_allowed(\n        capture.status,\n        requested_status,\n    ):\n        raise HTTPException(\n            status_code=400,\n            detail=(f\"Invalid state transition: {capture.status} -> {requested_status}\"),\n        )\n\n    changed = False\n    updated = capture.model_copy(deep=True)\n\n    if requested_status is not None and requested_status != capture.status:\n        updated.status = requested_status\n        changed = True\n    if req.user_note is not None and req.user_note != capture.user_note:","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/book.py#L395-L431","documentation":"Error \"Learning capture not found\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/book.py:413 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"}