Commit 879e8de7 authored by Thomas Bernhart's avatar Thomas Bernhart
Browse files

Handle FileNotFoundError when copying media files and thumbnails

parent 24161fd4
......@@ -13,8 +13,11 @@ def _copy_file(source_file, destination_directory, destination_filename, logger)
makedirs(destination_directory)
destination_path = path.join(destination_directory, destination_filename)
copy2(source_file, destination_path, follow_symlinks=False)
logger.info("Exported file '" + source_file + "' to '" + destination_path + "'")
try:
copy2(source_file, destination_path, follow_symlinks=False)
logger.info("Exported file '" + source_file + "' to '" + destination_path + "'")
except FileNotFoundError as not_found_error:
logger.error("Error while copying file '" + source_file + "'", exc_info=not_found_error)
def _normalize_document_id(document_id):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment