|
@@ -29,7 +29,7 @@ from ..helpers import prepare_subprocess_env
|
|
|
from ..helpers import sig_int, ignore_sigint
|
|
|
from ..helpers import iter_separated
|
|
|
from ..helpers import MakePathSafeAction
|
|
|
-from ..helpers import Error, CommandError, BackupWarning, BackupOSWarning, FileChangedWarning
|
|
|
+from ..helpers import Error, CommandError, BackupWarning, FileChangedWarning
|
|
|
from ..manifest import Manifest
|
|
|
from ..patterns import PatternMatcher
|
|
|
from ..platform import is_win32
|
|
@@ -87,7 +87,7 @@ class CreateMixIn:
|
|
|
rc = proc.wait()
|
|
|
if rc != 0:
|
|
|
raise CommandError("Command %r exited with status %d", args.paths[0], rc)
|
|
|
- except BackupOSError as e:
|
|
|
+ except BackupError as e:
|
|
|
raise Error("%s: %s", path, e)
|
|
|
else:
|
|
|
status = "+" # included
|
|
@@ -121,9 +121,6 @@ class CreateMixIn:
|
|
|
read_special=args.read_special,
|
|
|
dry_run=dry_run,
|
|
|
)
|
|
|
- except BackupOSError as e:
|
|
|
- self.print_warning_instance(BackupOSWarning(path, e))
|
|
|
- status = "E"
|
|
|
except BackupError as e:
|
|
|
self.print_warning_instance(BackupWarning(path, e))
|
|
|
status = "E"
|
|
@@ -151,8 +148,8 @@ class CreateMixIn:
|
|
|
status = fso.process_pipe(
|
|
|
path=path, cache=cache, fd=sys.stdin.buffer, mode=mode, user=user, group=group
|
|
|
)
|
|
|
- except BackupOSError as e:
|
|
|
- self.print_warning_instance(BackupOSWarning(path, e))
|
|
|
+ except BackupError as e:
|
|
|
+ self.print_warning_instance(BackupWarning(path, e))
|
|
|
status = "E"
|
|
|
else:
|
|
|
status = "+" # included
|
|
@@ -183,9 +180,9 @@ class CreateMixIn:
|
|
|
# if we get back here, we've finished recursing into <path>,
|
|
|
# we do not ever want to get back in there (even if path is given twice as recursion root)
|
|
|
skip_inodes.add((st.st_ino, st.st_dev))
|
|
|
- except BackupOSError as e:
|
|
|
+ except BackupError as e:
|
|
|
# this comes from os.stat, self._rec_walk has own exception handler
|
|
|
- self.print_warning_instance(BackupOSWarning(path, e))
|
|
|
+ self.print_warning_instance(BackupWarning(path, e))
|
|
|
continue
|
|
|
if not dry_run:
|
|
|
if args.progress:
|
|
@@ -368,7 +365,7 @@ class CreateMixIn:
|
|
|
else:
|
|
|
self.print_warning("Unknown file type: %s", path)
|
|
|
return
|
|
|
- except (BackupError, BackupOSError) as err:
|
|
|
+ except BackupError as err:
|
|
|
if isinstance(err, BackupOSError):
|
|
|
if err.errno in (errno.EPERM, errno.EACCES):
|
|
|
# Do not try again, such errors can not be fixed by retrying.
|
|
@@ -524,9 +521,6 @@ class CreateMixIn:
|
|
|
dry_run=dry_run,
|
|
|
)
|
|
|
|
|
|
- except BackupOSError as e:
|
|
|
- self.print_warning_instance(BackupOSWarning(path, e))
|
|
|
- status = "E"
|
|
|
except BackupError as e:
|
|
|
self.print_warning_instance(BackupWarning(path, e))
|
|
|
status = "E"
|