Skip to content

Commit

Permalink
throw an exception when reading outside of an array
Browse files Browse the repository at this point in the history
  • Loading branch information
normanrz committed Mar 13, 2024
1 parent 2bfcb61 commit 850de50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/dev/zarr/zarrjava/v3/Array.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 850de50

Please sign in to comment.