summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Smith <joshsmith@codethink.co.uk>2018-07-25 12:39:12 +0100
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-07-27 14:30:32 +0900
commit4fda15d28d751054e4d47c71c95e9d493e1da3e7 (patch)
treeca37ab95c6ba1af2c4db6a8e7bb072b553e95bbd
parent19ce57340f1279d0330408682af686a0d91e6ec6 (diff)
downloadbuildstream-4fda15d28d751054e4d47c71c95e9d493e1da3e7.tar.gz
cascache.py: Update cache push/pull errors to be temporary
Further work needs to be done for the current grpc exceptions which are reraised.
-rw-r--r--buildstream/_artifactcache/cascache.py2
-rw-r--r--buildstream/_exceptions.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index 1e84c282f..32de7d191 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -334,7 +334,7 @@ class CASCache(ArtifactCache):
except grpc.RpcError as e:
if e.code() != grpc.StatusCode.RESOURCE_EXHAUSTED:
- raise ArtifactError("Failed to push artifact {}: {}".format(refs, e)) from e
+ raise ArtifactError("Failed to push artifact {}: {}".format(refs, e), temporary=True) from e
return pushed
diff --git a/buildstream/_exceptions.py b/buildstream/_exceptions.py
index ada697a53..2b1d379c4 100644
--- a/buildstream/_exceptions.py
+++ b/buildstream/_exceptions.py
@@ -254,8 +254,8 @@ class SandboxError(BstError):
# Raised when errors are encountered in the artifact caches
#
class ArtifactError(BstError):
- def __init__(self, message, *, detail=None, reason=None):
- super().__init__(message, detail=detail, domain=ErrorDomain.ARTIFACT, reason=reason)
+ def __init__(self, message, *, detail=None, reason=None, temporary=False):
+ super().__init__(message, detail=detail, domain=ErrorDomain.ARTIFACT, reason=reason, temporary=True)
# PipelineError