diff --git a/jobs/source_file_sorter/job.py b/jobs/source_file_sorter/job.py
index b6fee7cbd849ec6a57eea23624cef81f603fe6f1..8fde6a0bbe71a25500812663d55d8c892659adb7 100644
--- a/jobs/source_file_sorter/job.py
+++ b/jobs/source_file_sorter/job.py
@@ -359,7 +359,7 @@ def _sort_medium(session: SessionDb, own_job_id: int, db_path: str):
             # Set AFTER moving the file, as moving is more likely to throw exception than setting the variable
             # Note that with an exception the medium variables will still be updated in the database
             medium.file_path = _get_db_path(dest_file)
-    except Exception as e:
+    except IOError as e:  # Don't catch stuff like database errors
         logger.error("Exception while sorting medium", exc_info=e)
         medium.sorter_error_message = f"Exception while sorting: {e}"
         medium.lecture_id = None