Skip to content

Error granularity: MediaSource + MediaParser errors silently swallowed in extractor #110

Closed

Description

@utof

Context

crates/media/src/extractor.rs read_exif returns (None, None, None) on both MediaSource::file_path errors (permissions, disk I/O, symlink loops) and MediaParser::parse errors (malformed EXIF, unsupported container). These are semantically distinct:

  • MediaSource error: probably a real bug — file should be openable.
  • Parse error: normal — file has no EXIF.

Current code treats both as "no EXIF"; only a debug! trace differentiates.

This is pre-existing (kamadak-exif also returned empty on File::open failure) but worth fixing before the architecture spec introduces typed CoreError propagation across boundaries. Applies to both image and video extractors.

Task

Split the error handling: propagate MediaSource errors upward as CoreError::Internal; continue to swallow MediaParser::parse errors as "no EXIF."

Acceptance

  • Image + video extractor paths distinguish I/O errors from parse errors.
  • Tracing for parse errors stays at debug; I/O errors rise to warn and propagate.
  • Test coverage for both paths.

Parent

Surfaced by L3 code review (double reviewer pass, 2026-04-20). Library/stack audit umbrella #80; architecture-spec-followup label because the architecture spec will own typed-error propagation semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/chore

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions