You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2022/05/10 22:50:40 UTC

[buildstream] branch tristan/handle-asset-cache-error created (now 4981082d0)

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a change to branch tristan/handle-asset-cache-error
in repository https://gitbox.apache.org/repos/asf/buildstream.git


      at 4981082d0 _elementsourcescache.py: Properly handle AssetCacheError

This branch includes the following new commits:

     new 4981082d0 _elementsourcescache.py: Properly handle AssetCacheError

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[buildstream] 01/01: _elementsourcescache.py: Properly handle AssetCacheError

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/handle-asset-cache-error
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 4981082d00314d3b557f6d0f06a6b3ce62e4f054
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Wed May 11 07:49:39 2022 +0900

    _elementsourcescache.py: Properly handle AssetCacheError
---
 src/buildstream/_elementsourcescache.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/buildstream/_elementsourcescache.py b/src/buildstream/_elementsourcescache.py
index e5587b1db..fcbd98794 100644
--- a/src/buildstream/_elementsourcescache.py
+++ b/src/buildstream/_elementsourcescache.py
@@ -260,11 +260,8 @@ class ElementSourcesCache(AssetCache):
             # Skip push if source is already on the server
             if response and response.blob_digest == source_digest:
                 return False
-        except grpc.RpcError as e:
-            if e.code() != grpc.StatusCode.NOT_FOUND:
-                raise SourceCacheError(
-                    "Error checking source cache with status {}: {}".format(e.code().name, e.details()), temporary=True
-                )
+        except AssetCacheError as e:
+            raise SourceCacheError("Error checking source cache: {}".format(e), temporary=True) from e
 
         referenced_directories = [source_proto.files]