MsgError

Overview

MsgError is raised by MsgReader, MsgDocument, and related classes when an MSG file is structurally invalid or cannot be parsed. It inherits directly from Python’s built-in Exception. Catch it to distinguish MSG-specific failures from other I/O or value errors. When strict=False (the default), minor non-fatal issues are recorded in validation_issues rather than raising MsgError; the exception is reserved for unrecoverable structural problems.

from aspose.email_foss.msg import MsgReader, MsgError

try:
    reader = MsgReader.from_file("invalid.msg")
except MsgError as e:
    print(f"MSG error: {e}")

Bases

Exception

See Also