Skip to content

symfonic.agent.attachments.errors

errors

Error taxonomy for the attachment text-extraction helpers.

Spec §3 defines the three subclasses. All inherit from AttachmentExtractionError so callers can catch a single base type.

AttachmentExtractionError

Bases: Exception

Base for all attachment extractor errors.

ExtractionDependencyMissingError

Bases: AttachmentExtractionError

An extractor is registered but its optional dependency is not installed.

The exception message always names the pip install extra the caller should add, e.g. pip install symfonic-core[attachments-pdf].

ExtractionFailedError

Bases: AttachmentExtractionError

The dependency is present but extraction itself failed.

Common causes: corrupt or password-protected file, zero-confidence OCR, unexpected format inside the container.

__cause__ is always set to the underlying library exception so callers can inspect or log it.

UnsupportedAttachmentError

Bases: AttachmentExtractionError

No extractor is registered for this (kind, media_type) combination.

Also raised when source_type="url" is passed — the helper never fetches remote URLs (SSRF avoidance; spec §4).