summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-06-24 08:19:48 +0200
committerbst-marge-bot <marge-bot@buildstream.build>2020-08-13 09:24:43 +0000
commit162dd86d466ed440c975f308a94da686740a3118 (patch)
tree5a885b66a9b36a4fabceace36f118848ffba09e8
parentdd315917a243c4353c53038e9517b439a88a8bf8 (diff)
downloadbuildstream-162dd86d466ed440c975f308a94da686740a3118.tar.gz
Rename CacheError to AssetCacheError
-rw-r--r--src/buildstream/_artifactcache.py4
-rw-r--r--src/buildstream/_assetcache.py8
-rw-r--r--src/buildstream/_exceptions.py4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/buildstream/_artifactcache.py b/src/buildstream/_artifactcache.py
index f310ea615..ad70fad94 100644
--- a/src/buildstream/_artifactcache.py
+++ b/src/buildstream/_artifactcache.py
@@ -23,7 +23,7 @@ import grpc
from ._assetcache import AssetCache
from ._cas.casremote import BlobNotFound
-from ._exceptions import ArtifactError, CASError, CacheError, CASRemoteError, RemoteError
+from ._exceptions import ArtifactError, AssetCacheError, CASError, CASRemoteError, RemoteError
from ._protos.buildstream.v2 import buildstream_pb2, buildstream_pb2_grpc, artifact_pb2, artifact_pb2_grpc
from ._remote import BaseRemote
@@ -201,7 +201,7 @@ class ArtifactCache(AssetCache):
def remove(self, ref):
try:
self._remove_ref(ref)
- except CacheError as e:
+ except AssetCacheError as e:
raise ArtifactError("{}".format(e)) from e
# push():
diff --git a/src/buildstream/_assetcache.py b/src/buildstream/_assetcache.py
index 05abb406e..b4f0f945e 100644
--- a/src/buildstream/_assetcache.py
+++ b/src/buildstream/_assetcache.py
@@ -25,7 +25,7 @@ from . import utils
from . import _yaml
from ._cas import CASRemote
from ._message import Message, MessageType
-from ._exceptions import LoadError, RemoteError, CacheError
+from ._exceptions import AssetCacheError, LoadError, RemoteError
from ._remote import RemoteSpec, RemoteType
@@ -430,13 +430,13 @@ class AssetCache:
# ref (str): The ref to remove
#
# Raises:
- # (CASCacheError): If the ref didnt exist, or a system error
+ # (AssetCacheError): If the ref didnt exist, or a system error
# occurred while removing it
#
def _remove_ref(self, ref):
try:
utils._remove_path_with_parents(self._basedir, ref)
except FileNotFoundError as e:
- raise CacheError("Could not find ref '{}'".format(ref)) from e
+ raise AssetCacheError("Could not find ref '{}'".format(ref)) from e
except OSError as e:
- raise CacheError("System error while removing ref '{}': {}".format(ref, e)) from e
+ raise AssetCacheError("System error while removing ref '{}': {}".format(ref, e)) from e
diff --git a/src/buildstream/_exceptions.py b/src/buildstream/_exceptions.py
index 755da3a9d..80008b884 100644
--- a/src/buildstream/_exceptions.py
+++ b/src/buildstream/_exceptions.py
@@ -171,11 +171,11 @@ class SandboxError(BstError):
super().__init__(message, detail=detail, domain=ErrorDomain.SANDBOX, reason=reason)
-# CacheError
+# AssetCacheError
#
# Raised when errors are encountered in either type of cache
#
-class CacheError(BstError):
+class AssetCacheError(BstError):
def __init__(self, message, detail=None, reason=None):
super().__init__(message, detail=detail, domain=ErrorDomain.SANDBOX, reason=reason)