1 parent d2a0d03 commit aba2e7aCopy full SHA for aba2e7a
1 file changed
tilebox-workflows/tilebox/workflows/cache.py
@@ -10,6 +10,7 @@
10
from botocore.exceptions import ClientError
11
from google.cloud.exceptions import NotFound
12
from google.cloud.storage import Blob, Bucket
13
+from obstore.exceptions import GenericError
14
from obstore.store import ObjectStore
15
16
@@ -100,7 +101,9 @@ def __getitem__(self, key: str) -> bytes:
100
101
try:
102
entry = self.store.get(str(self.prefix / key))
103
return bytes(entry.bytes())
- except OSError:
104
+ except (OSError, GenericError):
105
+ # GenericError is raised if the key contains separator characters, but one of the parents is a file
106
+ # instead of a directory
107
raise KeyError(f"{key} is not cached!") from None
108
109
def __iter__(self) -> Iterator[str]:
0 commit comments