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

Method inject_exception

src/borg/remote.py:398–418  ·  view source on GitHub ↗
(self, kind)

Source from the content-addressed store, hash-verified

396 self.send_queued_log()
397
398 def inject_exception(self, kind):
399 s1 = "test string"
400 s2 = "test string2"
401 if kind == "DoesNotExist":
402 raise self.RepoCls.DoesNotExist(s1)
403 elif kind == "AlreadyExists":
404 raise self.RepoCls.AlreadyExists(s1)
405 elif kind == "CheckNeeded":
406 raise self.RepoCls.CheckNeeded(s1)
407 elif kind == "IntegrityError":
408 raise IntegrityError(s1)
409 elif kind == "PathNotAllowed":
410 raise PathNotAllowed("foo")
411 elif kind == "ObjectNotFound":
412 raise self.RepoCls.ObjectNotFound(s1, s2)
413 elif kind == "StoreObjectNotFound":
414 raise StoreObjectNotFound(s1)
415 elif kind == "InvalidRPCMethod":
416 raise InvalidRPCMethod(s1)
417 elif kind == "divide":
418 0 // 0
419
420
421class SleepingBandwidthLimiter:

Callers

nothing calls this directly

Calls 3

IntegrityErrorClass · 0.85
PathNotAllowedClass · 0.70
InvalidRPCMethodClass · 0.70

Tested by

no test coverage detected