CFBError

Overview

CFBError is the exception type raised by CFBReader and related utilities when a Compound File Binary container is malformed, truncated, or structurally invalid. It inherits from the built-in Exception class and carries a descriptive message indicating the nature of the parse failure.

Catch CFBError whenever reading untrusted or potentially corrupt CFB files to handle parse failures gracefully without crashing the application.

from aspose.email_foss.cfb import CFBReader, CFBError

try:
    reader = CFBReader.from_file("corrupt.cfb")
except CFBError as e:
    print(f"CFB error: {e}")

See Also