|
@@ -112,6 +112,12 @@ class UnexpectedRPCDataFormatFromServer(Error):
|
|
|
super().__init__(data)
|
|
|
|
|
|
|
|
|
+class ConnectionBrokenWithHint(Error):
|
|
|
+ """Connection to remote host is broken. {}"""
|
|
|
+
|
|
|
+ exit_mcode = 87
|
|
|
+
|
|
|
+
|
|
|
# Protocol compatibility:
|
|
|
# In general the server is responsible for rejecting too old clients and the client it responsible for rejecting
|
|
|
# too old servers. This ensures that the knowledge what is compatible is always held by the newer component.
|
|
@@ -428,7 +434,10 @@ class SleepingBandwidthLimiter:
|
|
|
self.ratelimit_last = time.monotonic()
|
|
|
if len(to_send) > self.ratelimit_quota:
|
|
|
to_send = to_send[: self.ratelimit_quota]
|
|
|
- written = os.write(fd, to_send)
|
|
|
+ try:
|
|
|
+ written = os.write(fd, to_send)
|
|
|
+ except BrokenPipeError:
|
|
|
+ raise ConnectionBrokenWithHint("Broken Pipe") from None
|
|
|
if self.ratelimit:
|
|
|
self.ratelimit_quota -= written
|
|
|
return written
|
|
@@ -780,6 +789,8 @@ class RemoteRepository:
|
|
|
raise IntegrityError(args[0])
|
|
|
elif error == "PathNotAllowed":
|
|
|
raise PathNotAllowed(args[0])
|
|
|
+ elif error == "PathPermissionDenied":
|
|
|
+ raise Repository.PathPermissionDenied(args[0])
|
|
|
elif error == "ParentPathDoesNotExist":
|
|
|
raise Repository.ParentPathDoesNotExist(args[0])
|
|
|
elif error == "ObjectNotFound":
|