epublib.exceptions module

exception EPUBWarning

Bases: Warning

Base warning for EPUBLib.

exception EPUBError

Bases: Exception

Base error for EPUBLib.

exception NotEPUBError(msg: str, *args: object)

Bases: EPUBError

The file is not an EPUB file.

exception ClosedEPUBError

Bases: EPUBError

An operation was attempted on a closed EPUB file.

warn(
warning: str,
cls: type[~epublib.exceptions.EPUBWarning] = <class 'epublib.exceptions.EPUBWarning'>,
) None

Utility function to issue an EPUBLib warning.

Parameters:
  • warning – The warning message.

  • cls – The warning class to use. Defaults to EPUBWarning.