diff --git a/src/borg/archiver/__init__.py b/src/borg/archiver/__init__.py index 48480b5e1..16ec1e1c9 100644 --- a/src/borg/archiver/__init__.py +++ b/src/borg/archiver/__init__.py @@ -644,7 +644,7 @@ def main(): # pragma: no cover tb = format_tb(e) exit_code = e.exit_code except RemoteRepository.RPCError as e: - important = e.exception_class not in ("LockTimeout",) and e.traceback + important = e.traceback msg = e.exception_full if important else e.get_message() msgid = e.exception_class tb_log_level = logging.ERROR if important else logging.DEBUG diff --git a/src/borg/remote.py b/src/borg/remote.py index 1471b495b..5d9cb1af9 100644 --- a/src/borg/remote.py +++ b/src/borg/remote.py @@ -30,6 +30,7 @@ from .helpers import safe_unlink from .helpers import prepare_subprocess_env, ignore_sigint from .helpers import get_socket_filename +from .locking import LockTimeout, NotLocked, NotMyLock, LockFailed from .logger import create_logger, borg_serve_log_queue from .helpers import msgpack from .repository import Repository @@ -781,6 +782,14 @@ def handle_error(unpacked): raise Repository.ObjectNotFound(args[0], self.location.processed) elif error == "InvalidRPCMethod": raise InvalidRPCMethod(args[0]) + elif error == "LockTimeout": + raise LockTimeout(args[0]) + elif error == "LockFailed": + raise LockFailed(args[0], args[1]) + elif error == "NotLocked": + raise NotLocked(args[0]) + elif error == "NotMyLock": + raise NotMyLock(args[0]) else: raise self.RPCError(unpacked)