HKUDS/DeepTutor · error · HTTPException
has no stored original to render.
Error message
{manifest.filename} has no stored original to render. What it means
Raw-render guard on GET /materials/{id}/raw: the manifest exists but raw_path() returned no stored original (None or missing file), so the faithful viewer has nothing to serve. Fires for materials ingested without original-bytes retention.
Solutions
- Re-upload the material with original-bytes retention enabled
- Client: fall back to the processed/extracted view when raw is unavailable
- Server: distinguish 'no original stored' (400/409) from 'material missing' (404) in the status code
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at deeptutor/api/routers/reading.py:261 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/376ac9b97fdca5de.
Report an issue: GitHub.
Appendix: source
Thrown at deeptutor/api/routers/reading.py:261
locator=locator,
unit=manifest.unit,
text=store.unit_text(material_id, locator),
)
except Exception as exc:
raise _http_error(exc) from exc
@router.get("/materials/{material_id}/raw")
async def get_raw(material_id: str) -> FileResponse:
"""The original bytes, for the faithful viewer. Serves Range requests."""
store = _store()
try:
manifest = store.manifest(material_id)
path = store.raw_path(material_id)
except Exception as exc:
raise _http_error(exc) from exc
if path is None or not path.is_file():
raise HTTPException(
status_code=404,
detail=f"{manifest.filename} has no stored original to render.",
)
return FileResponse(
path,
media_type=manifest.mime or "application/octet-stream",
filename=manifest.filename,
content_disposition_type="inline",
)
@router.get("/materials/{material_id}/annotations", response_model=list[AnnotationInfo])
async def list_annotations(material_id: str) -> list[AnnotationInfo]:
store = _store()
try:
return [_annotation_info(row) for row in store.annotations(material_id)]
except Exception as exc:
raise _http_error(exc) from excView on GitHub (pinned to 3e82f13042)