summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-07-26 14:39:24 +0100
committerJürg Billeter <j@bitron.ch>2017-07-26 14:41:24 +0100
commit9b54d40ec8267fef8c3e1a75729c0bf6ba34579d (patch)
tree115942f0d3d9a24949b54e01529a9eaae7d7bd2e
parent98f01d66c37098e8c659feb9bc0c73332ca41cd1 (diff)
downloadbuildstream-9b54d40ec8267fef8c3e1a75729c0bf6ba34579d.tar.gz
_artifactcache/pushreceive.py: Raise PushException on connection failure
Unexpected connection termination should not be considered a bug. Fixes #51
-rw-r--r--buildstream/_artifactcache/pushreceive.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/buildstream/_artifactcache/pushreceive.py b/buildstream/_artifactcache/pushreceive.py
index 774fac30a..fd5b1d96d 100644
--- a/buildstream/_artifactcache/pushreceive.py
+++ b/buildstream/_artifactcache/pushreceive.py
@@ -649,6 +649,10 @@ def push(repo, remote, remote_port, branches, output):
try:
pusher.run()
return True
+ except ConnectionError as e:
+ # Connection attempt failed or connection was terminated unexpectedly
+ terminate_push()
+ raise PushException("Connection failed") from e
except PushException:
terminate_push()
raise