Skip to content

Commit 00042f6

Browse files
committed
Partial resolution (exception lifted then continued) while waiting for the complete resolution of a major decoding problem.
1 parent 7658697 commit 00042f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/MetaDetective/MetaDetective.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,17 @@ def get_metadata(file_path: str, fields: List[str]) -> dict:
263263
264264
Raises:
265265
subprocess.CalledProcessError: If there's an error executing exiftool.
266+
UnicodeDecodeError: If there's an error decoding the exiftool output.
266267
"""
267268
try:
268269
exiftool_output = subprocess.run(["exiftool", file_path], capture_output=True, text=True, check=True)
269270
except subprocess.CalledProcessError as e:
270271
print(f"Error executing exiftool: {e}")
272+
print()
273+
return {}
274+
except UnicodeDecodeError as e:
275+
print(f"Error decoding output for file {file_path}: {e}")
276+
print()
271277
return {}
272278

273279
field_set = set(fields)

0 commit comments

Comments
 (0)