Skip to content

Commit 850de50

Browse files
committed
throw an exception when reading outside of an array
1 parent 2bfcb61 commit 850de50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/dev/zarr/zarrjava/v3/Array.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ boolean chunkIsInArray(long[] chunkCoords) {
212212
public ucar.ma2.Array readChunk(long[] chunkCoords)
213213
throws ZarrException {
214214
if (!chunkIsInArray(chunkCoords)) {
215-
return metadata.allocateFillValueChunk();
215+
throw new ZarrException("Attempting to read data outside of the array's domain.");
216216
}
217217

218218
final String[] chunkKeys = metadata.chunkKeyEncoding.encodeChunkKey(chunkCoords);

0 commit comments

Comments
 (0)