MCPcopy
hub / github.com/borgbackup/borg / handle_error

Method handle_error

src/borg/legacyremote.py:465–503  ·  view source on GitHub ↗
(unpacked)

Source from the content-addressed store, hash-verified

463 return msgid
464
465 def handle_error(unpacked):
466 if "exception_class" not in unpacked:
467 return
468
469 error = unpacked["exception_class"]
470 args = unpacked["exception_args"]
471
472 if error == "Error":
473 raise Error(args[0])
474 elif error == "ErrorWithTraceback":
475 raise ErrorWithTraceback(args[0])
476 elif error == "DoesNotExist":
477 raise LegacyRepository.DoesNotExist(self.location.processed)
478 elif error == "AlreadyExists":
479 raise LegacyRepository.AlreadyExists(self.location.processed)
480 elif error == "CheckNeeded":
481 raise LegacyRepository.CheckNeeded(self.location.processed)
482 elif error == "IntegrityError":
483 raise IntegrityError(args[0])
484 elif error == "PathNotAllowed":
485 raise PathNotAllowed(args[0])
486 elif error == "PathPermissionDenied":
487 raise LegacyRepository.PathPermissionDenied(args[0])
488 elif error == "ParentPathDoesNotExist":
489 raise LegacyRepository.ParentPathDoesNotExist(args[0])
490 elif error == "ObjectNotFound":
491 raise LegacyRepository.ObjectNotFound(args[0], self.location.processed)
492 elif error == "InvalidRPCMethod":
493 raise InvalidRPCMethod(args[0])
494 elif error == "LockTimeout":
495 raise LockTimeout(args[0])
496 elif error == "LockFailed":
497 raise LockFailed(args[0], args[1])
498 elif error == "NotLocked":
499 raise NotLocked(args[0])
500 elif error == "NotMyLock":
501 raise NotMyLock(args[0])
502 else:
503 raise self.RPCError(unpacked)
504
505 calls = list(calls)
506 waiting_for = []

Callers

nothing calls this directly

Calls 9

ErrorClass · 0.85
ErrorWithTracebackClass · 0.85
IntegrityErrorClass · 0.85
PathNotAllowedClass · 0.70
InvalidRPCMethodClass · 0.70
LockTimeoutClass · 0.70
LockFailedClass · 0.70
NotLockedClass · 0.70
NotMyLockClass · 0.70

Tested by

no test coverage detected