{"record":{"id":"10ff330bcfe94674","repo":"HKUDS/DeepTutor","slug":"material-material-id-r-not-found","errorCode":null,"errorMessage":"material {material_id!r} not found","messagePattern":"material (.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"deeptutor/api/routers/reading.py","lineNumber":232,"sourceCode":"\n@router.get(\"/materials/{material_id}\", response_model=MaterialDetail)\nasync def get_material(material_id: str) -> MaterialDetail:\n    store = _store()\n    try:\n        return _detail(store, store.manifest(material_id))\n    except Exception as exc:\n        raise _http_error(exc) from exc\n\n\n@router.delete(\"/materials/{material_id}\")\nasync def delete_material(material_id: str) -> dict[str, Any]:\n    store = _store()\n    try:\n        removed = store.delete(material_id)\n    except Exception as exc:\n        raise _http_error(exc) from exc\n    if not removed:\n        raise HTTPException(status_code=404, detail=f\"material {material_id!r} not found\")\n    return {\"status\": \"ok\", \"material_id\": material_id}\n\n\n@router.get(\"/materials/{material_id}/units/{locator}\", response_model=UnitText)\nasync def get_unit(material_id: str, locator: int) -> UnitText:\n    \"\"\"One unit's text — the reader's text view, and the only view for non-PDFs.\"\"\"\n    store = _store()\n    try:\n        manifest = store.manifest(material_id)\n        return UnitText(\n            locator=locator,\n            unit=manifest.unit,\n            text=store.unit_text(material_id, locator),\n        )\n    except Exception as exc:\n        raise _http_error(exc) from exc\n\n","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/reading.py#L214-L250","documentation":"Error \"material {material_id!r} not found\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/reading.py:232 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"}