{"record":{"id":"7865b8017c2490c7","repo":"HKUDS/DeepTutor","slug":"invalid-capture-status-raw","errorCode":null,"errorMessage":"Invalid capture status: {raw}","messagePattern":"Invalid capture status: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"deeptutor/api/routers/book.py","lineNumber":185,"sourceCode":"    payload = \"|\".join(\n        [\n            book_id,\n            page_id,\n            block_id,\n            locator,\n            _normalize_capture_text(text),\n        ],\n    ).encode(\"utf-8\")\n    return hashlib.sha256(payload).hexdigest()\n\n\ndef _coerce_capture_status(raw: str | None) -> LearningCaptureStatus | None:\n    if raw is None:\n        return None\n    try:\n        return LearningCaptureStatus(raw)\n    except ValueError as exc:\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Invalid capture status: {raw}\",\n        ) from exc\n\n\n_CAPTURE_TRANSITIONS: dict[LearningCaptureStatus, set[LearningCaptureStatus]] = {\n    LearningCaptureStatus.CAPTURED: {\n        LearningCaptureStatus.CAPTURED,\n        LearningCaptureStatus.DRAFTED,\n        LearningCaptureStatus.PENDING_CONFIRMATION,\n        LearningCaptureStatus.APPROVED,\n        LearningCaptureStatus.REJECTED,\n    },\n    LearningCaptureStatus.DRAFTED: {\n        LearningCaptureStatus.DRAFTED,\n        LearningCaptureStatus.PENDING_CONFIRMATION,\n        LearningCaptureStatus.APPROVED,\n        LearningCaptureStatus.REJECTED,","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/book.py#L167-L203","documentation":"Error \"Invalid capture status: {raw}\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/book.py:185 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"}