Skip to content

docx_plus.core.errors

The library base exception. DocxPlusError is the root of every typed error in docx_plus — each submodule subclasses it so callers can catch the library's failures without also catching unrelated ValueError / RuntimeError instances from python-docx or lxml.

docx_plus.core.errors

Library base error class, isolated to break an import cycle.

:class:DocxPlusError lives here — in a module that imports nothing else from docx_plus.core — so the other core submodules (ids, ns, …) can subclass it with a plain top-of-file import instead of the # noqa: E402 ordering dance that an in-__init__ definition would force. core/__init__ re-exports it, so the documented short form from docx_plus.core import DocxPlusError is unchanged. SPEC §9.7.

DocxPlusError

Bases: Exception

Base class for all library-raised errors.

Every typed error in docx_plus subclasses this so callers can catch the library's failures without catching unrelated ValueError/RuntimeError instances from python-docx or lxml.