File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 22
33### Enhancements
44
5+ * ` xcube serve ` used to shut down with an error message
6+ if it encountered datasets it could not open. New behaviour
7+ is to emit a warning and ignore such datasets. (#630 )
8+
59* Introduced helper function ` add_spatial_ref() `
610 of package ` xcube.core.gridmapping.cfconv ` that allows
711 adding a spatial coordinate reference system to an existing
Original file line number Diff line number Diff line change 2929from xcube .constants import LOG
3030from xcube .core .geom import get_dataset_bounds
3131from xcube .core .normalize import DatasetIsNotACubeError
32+ from xcube .core .store import DataStoreError
3233from xcube .core .timecoord import timestamp_to_iso_string
3334from xcube .util .assertions import assert_instance
3435from xcube .util .cmaps import get_cmaps
@@ -136,7 +137,11 @@ def get_dataset(ctx: ServiceContext,
136137 required_scopes = ctx .get_required_dataset_scopes (dataset_config )
137138 assert_scopes (required_scopes , granted_scopes or set ())
138139
139- ml_ds = ctx .get_ml_dataset (ds_id )
140+ try :
141+ ml_ds = ctx .get_ml_dataset (ds_id )
142+ except (ValueError , DataStoreError ) as e :
143+ raise DatasetIsNotACubeError (f'could not open dataset: { e } ' ) from e
144+
140145 grid_mapping = ml_ds .grid_mapping
141146 if not grid_mapping .crs .is_geographic :
142147 raise CubeIsNotDisplayable (f'CRS is not geographic:'
You can’t perform that action at this time.
0 commit comments