HKUDS/DeepTutor · error · HTTPException

Link not found

Error message

Link not found

What it means

Error "Link not found" thrown in HKUDS/DeepTutor.

Source

Thrown at deeptutor/api/routers/question_notebook.py:341

@router.post("/entries/{entry_id}/categories")
async def add_entry_to_category(entry_id: int, payload: CategoryAddRequest):
    store = get_sqlite_session_store()
    entry = await store.get_notebook_entry(entry_id)
    if entry is None:
        raise HTTPException(status_code=404, detail="Entry not found")
    ok = await store.add_entry_to_category(entry_id, payload.category_id)
    if not ok:
        raise HTTPException(status_code=400, detail="Failed to add to category")
    return {"added": True, "entry_id": entry_id, "category_id": payload.category_id}


@router.delete("/entries/{entry_id}/categories/{category_id}")
async def remove_entry_from_category(entry_id: int, category_id: int):
    store = get_sqlite_session_store()
    removed = await store.remove_entry_from_category(entry_id, category_id)
    if not removed:
        raise HTTPException(status_code=404, detail="Link not found")
    return {"removed": True, "entry_id": entry_id, "category_id": category_id}


# ── Overview ─────────────────────────────────────────────────────


@router.get("/stats", response_model=QuestionBankStats)
async def question_bank_stats() -> QuestionBankStats:
    """Counts behind the filter chips; also the agent's one-call overview."""
    store = get_sqlite_session_store()
    return QuestionBankStats(**await store.question_bank_stats())


# ── Category CRUD ────────────────────────────────────────────────


@router.get("/categories", response_model=list[CategoryItem])
async def list_categories():

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/api/routers/question_notebook.py:341 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/2c3ced30aa8aa2c4. Report an issue: GitHub.