Skip to content

Commit

Permalink
improve error message and ignore access error to system volume inform…
Browse files Browse the repository at this point in the history
…ation on Windows
  • Loading branch information
huettenhain committed Dec 13, 2024
1 parent 605340f commit 9bd02e9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion refinery/units/meta/ef.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
from refinery.units import Arg, Unit


_ERROR_IGNORES = {
'nt': {'system volume information'}
}


class ef(Unit):
"""
Short for "emit file". The unit reads files from disk and outputs them individually. Has the ability to
Expand Down Expand Up @@ -154,7 +159,9 @@ def _patched_scandir(path):
try:
return scandir(path)
except Exception as e:
self.log_warn('error calling scandir:', exception_to_string(e))
ignore = _ERROR_IGNORES.get(os.name, set())
if not any(p.lower() in ignore for p in Path(path).parts):
self.log_warn(F'error calling scandir, {exception_to_string(e)}: {path}')
return EmptyIterator()

try:
Expand Down

0 comments on commit 9bd02e9

Please sign in to comment.