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

Method handle_error

src/borg/remote.py:765–815  ·  view source on GitHub ↗
(unpacked)

Source from the content-addressed store, hash-verified

763 return msgid
764
765 def handle_error(unpacked):
766 if "exception_class" not in unpacked:
767 return
768
769 error = unpacked["exception_class"]
770 args = unpacked["exception_args"]
771
772 if error == "Error":
773 raise Error(args[0])
774 elif error == "ErrorWithTraceback":
775 raise ErrorWithTraceback(args[0])
776 elif error == "InvalidRepository":
777 raise Repository.InvalidRepository(self.location.processed)
778 elif error == "DoesNotExist":
779 raise Repository.DoesNotExist(self.location.processed)
780 elif error == "AlreadyExists":
781 raise Repository.AlreadyExists(self.location.processed)
782 elif error == "CheckNeeded":
783 raise Repository.CheckNeeded(self.location.processed)
784 elif error == "IntegrityError":
785 raise IntegrityError(args[0])
786 elif error == "PathNotAllowed":
787 raise PathNotAllowed(args[0])
788 elif error == "PathPermissionDenied":
789 raise Repository.PathPermissionDenied(args[0])
790 elif error == "PathAlreadyExists":
791 raise Repository.PathAlreadyExists(args[0])
792 elif error == "ParentPathDoesNotExist":
793 raise Repository.ParentPathDoesNotExist(args[0])
794 elif error == "ObjectNotFound":
795 raise Repository.ObjectNotFound(args[0], self.location.processed)
796 elif error == "StoreObjectNotFound":
797 raise StoreObjectNotFound(args[0])
798 elif error == "InvalidRPCMethod":
799 raise InvalidRPCMethod(args[0])
800 elif error == "LockTimeout":
801 raise LockTimeout(args[0])
802 elif error == "LockFailed":
803 raise LockFailed(args[0], args[1])
804 elif error == "NotLocked":
805 raise NotLocked(args[0])
806 elif error == "NotMyLock":
807 raise NotMyLock(args[0])
808 elif error == "NoManifestError":
809 raise NoManifestError
810 elif error == "InsufficientFreeSpaceError":
811 raise Repository.InsufficientFreeSpaceError(args[0], args[1])
812 elif error == "InvalidRepositoryConfig":
813 raise Repository.InvalidRepositoryConfig(self.location.processed, args[1])
814 else:
815 raise self.RPCError(unpacked)
816
817 calls = list(calls)
818 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