From 850de5056e300e42887af67965a3cbb5f7c790a4 Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Wed, 13 Mar 2024 20:05:03 +0100 Subject: [PATCH] throw an exception when reading outside of an array --- src/main/java/dev/zarr/zarrjava/v3/Array.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/zarr/zarrjava/v3/Array.java b/src/main/java/dev/zarr/zarrjava/v3/Array.java index bbe97bf..631ef70 100644 --- a/src/main/java/dev/zarr/zarrjava/v3/Array.java +++ b/src/main/java/dev/zarr/zarrjava/v3/Array.java @@ -212,7 +212,7 @@ boolean chunkIsInArray(long[] chunkCoords) { public ucar.ma2.Array readChunk(long[] chunkCoords) throws ZarrException { if (!chunkIsInArray(chunkCoords)) { - return metadata.allocateFillValueChunk(); + throw new ZarrException("Attempting to read data outside of the array's domain."); } final String[] chunkKeys = metadata.chunkKeyEncoding.encodeChunkKey(chunkCoords);