Skip to content

Commit 9ec79a0

Browse files
committed
xcube server to ignore datasets that cannot be opened
1 parent b2e06a9 commit 9ec79a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xcube/webapi/controllers/catalogue.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from xcube.constants import LOG
3030
from xcube.core.geom import get_dataset_bounds
3131
from xcube.core.normalize import DatasetIsNotACubeError
32+
from xcube.core.store import DataStoreError
3233
from xcube.core.timecoord import timestamp_to_iso_string
3334
from xcube.util.assertions import assert_instance
3435
from xcube.util.cmaps import get_cmaps
@@ -40,7 +41,7 @@
4041
from xcube.webapi.controllers.tiles import get_dataset_tile_url
4142
from xcube.webapi.controllers.tiles import get_tile_source_options
4243
from xcube.webapi.errors import ServiceBadRequestError
43-
import zarr
44+
4445

4546
def get_datasets(ctx: ServiceContext,
4647
details: bool = False,
@@ -138,7 +139,7 @@ def get_dataset(ctx: ServiceContext,
138139

139140
try:
140141
ml_ds = ctx.get_ml_dataset(ds_id)
141-
except ValueError as e:
142+
except (ValueError, DataStoreError) as e:
142143
raise DatasetIsNotACubeError(f'could not open dataset: {e}') from e
143144

144145
grid_mapping = ml_ds.grid_mapping

0 commit comments

Comments
 (0)