HKUDS/DeepTutor · error · HTTPException
material not found
Error message
material {material_id!r} not found What it means
Store lookup guard: no material with the given material_id exists (or it is no longer resolvable), raised from manifest/raw access paths and surfaced as a 404 so clients stop treating stale ids as valid.
Solutions
- List materials via GET /materials to obtain current ids
- Handle 404 by clearing the cached material reference in the client
- If the material was expected, check server logs for storage deletion or migration
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at deeptutor/api/routers/reading.py:232 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27).
Data as JSON: /api/errors/10ff330bcfe94674.
Report an issue: GitHub.
Appendix: source
Thrown at deeptutor/api/routers/reading.py:232
@router.get("/materials/{material_id}", response_model=MaterialDetail)
async def get_material(material_id: str) -> MaterialDetail:
store = _store()
try:
return _detail(store, store.manifest(material_id))
except Exception as exc:
raise _http_error(exc) from exc
@router.delete("/materials/{material_id}")
async def delete_material(material_id: str) -> dict[str, Any]:
store = _store()
try:
removed = store.delete(material_id)
except Exception as exc:
raise _http_error(exc) from exc
if not removed:
raise HTTPException(status_code=404, detail=f"material {material_id!r} not found")
return {"status": "ok", "material_id": material_id}
@router.get("/materials/{material_id}/units/{locator}", response_model=UnitText)
async def get_unit(material_id: str, locator: int) -> UnitText:
"""One unit's text — the reader's text view, and the only view for non-PDFs."""
store = _store()
try:
manifest = store.manifest(material_id)
return UnitText(
locator=locator,
unit=manifest.unit,
text=store.unit_text(material_id, locator),
)
except Exception as exc:
raise _http_error(exc) from exc
View on GitHub (pinned to 3e82f13042)