Skip to content

Commit

Permalink
xcube server to ignore datasets that cannot be opened
Browse files Browse the repository at this point in the history
  • Loading branch information
forman committed Mar 1, 2022
1 parent b2e06a9 commit 9ec79a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xcube/webapi/controllers/catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from xcube.constants import LOG
from xcube.core.geom import get_dataset_bounds
from xcube.core.normalize import DatasetIsNotACubeError
from xcube.core.store import DataStoreError
from xcube.core.timecoord import timestamp_to_iso_string
from xcube.util.assertions import assert_instance
from xcube.util.cmaps import get_cmaps
Expand All @@ -40,7 +41,7 @@
from xcube.webapi.controllers.tiles import get_dataset_tile_url
from xcube.webapi.controllers.tiles import get_tile_source_options
from xcube.webapi.errors import ServiceBadRequestError
import zarr


def get_datasets(ctx: ServiceContext,
details: bool = False,
Expand Down Expand Up @@ -138,7 +139,7 @@ def get_dataset(ctx: ServiceContext,

try:
ml_ds = ctx.get_ml_dataset(ds_id)
except ValueError as e:
except (ValueError, DataStoreError) as e:
raise DatasetIsNotACubeError(f'could not open dataset: {e}') from e

grid_mapping = ml_ds.grid_mapping
Expand Down

0 comments on commit 9ec79a0

Please sign in to comment.