HKUDS/DeepTutor · error · HTTPException

Book not found

Error message

Book not found

What it means

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

Source

Thrown at deeptutor/api/routers/book.py:234

        LearningCaptureStatus.IMPORTED,
    },
    LearningCaptureStatus.IMPORTED: {LearningCaptureStatus.IMPORTED},
    LearningCaptureStatus.REJECTED: {LearningCaptureStatus.REJECTED},
}


def _is_capture_transition_allowed(
    current: LearningCaptureStatus,
    requested: LearningCaptureStatus,
) -> bool:
    return requested in _CAPTURE_TRANSITIONS.get(current, set())


def _derive_capture_title_values(book_id: str, page_id: str, block_id: str) -> tuple[str, str, str]:
    engine = get_book_engine()
    book = engine.load_book(book_id)
    if book is None:
        raise HTTPException(status_code=404, detail="Book not found")
    page = engine.load_page(book_id, page_id)
    if page is None:
        raise HTTPException(status_code=404, detail="Page not found")

    spine = engine.load_spine(book_id)
    chapter_title = page.title
    if spine is not None and page.chapter_id:
        for chapter in spine.chapters:
            if chapter.id == page.chapter_id:
                chapter_title = chapter.title
                break

    base_locator = f"/book/{book_id}/pages/{page_id}"
    source_locator = f"{base_locator}/block/{block_id}" if block_id else base_locator
    return book.title, chapter_title, source_locator


def _find_capture_duplicate(

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/api/routers/book.py:234 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/4506624957d6c56d. Report an issue: GitHub.