From 162dd86d466ed440c975f308a94da686740a3118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Wed, 24 Jun 2020 08:19:48 +0200 Subject: Rename CacheError to AssetCacheError --- src/buildstream/_artifactcache.py | 4 ++-- src/buildstream/_assetcache.py | 8 ++++---- src/buildstream/_exceptions.py | 4 ++-- 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) -- cgit v1.2.1