Skip to content

Commit 0f51005

Browse files
committed
clean error for unknown vector format
1 parent 80614ae commit 0f51005

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openeo_driver/datacube.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from openeo_driver.datastructs import ResolutionMergeArgs, SarBackscatterArgs, StacAsset
2626
from openeo_driver.errors import FeatureUnsupportedException, InternalException, ProcessGraphInvalidException, \
27-
OpenEOApiException
27+
OpenEOApiException, ProcessParameterInvalidException
2828
from openeo_driver.util.geometry import GeometryBufferer, reproject_geometry, validate_geojson_coordinates
2929
from openeo_driver.util.ioformats import IOFORMATS
3030
from openeo_driver.util.pgparsing import SingleRunUDFProcessGraph
@@ -600,7 +600,9 @@ def write_assets(
600600
filename = str(directory)
601601
directory_parent = Path(filename).parent
602602

603-
format_info = IOFORMATS.get(format)
603+
format_info = IOFORMATS.get(format, None)
604+
if format_info is None:
605+
raise ProcessParameterInvalidException(parameter="format", process="save_result", reason=f"Received unknown format: {format}, supported formats: {list(IOFORMATS.keys())}")
604606
# TODO: check if format can be used for vector data?
605607
path = directory_parent / f"vectorcube.{format_info.extension}"
606608

0 commit comments

Comments
 (0)