Skip to content

Commit c7f96c3

Browse files
committed
[FIX] exception type
1 parent 206c5d2 commit c7f96c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/scportrait/spdata/write/_helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
ShapesModel,
1111
TableModel,
1212
)
13+
from xarray_schema.base import SchemaError
1314

1415
SPATIALDATA_MODELS = [Labels2DModel, Labels3DModel, Image2DModel, Image3DModel, PointsModel, TableModel, ShapesModel]
1516

@@ -62,7 +63,7 @@ def add_element_sdata(sdata: SpatialData, element: spObject, element_name: str,
6263
for model in SPATIALDATA_MODELS:
6364
try:
6465
model().validate(element)
65-
except ValueError:
66+
except SchemaError:
6667
continue
6768
break # Exit loop early once validation is performed
6869

0 commit comments

Comments
 (0)