Skip to content

Commit 976c577

Browse files
committed
Raise OpenSlideError from ImageSlide rather than ValueError
1 parent 9c6f274 commit 976c577

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openslide/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ def read_region(self, location, layer, size):
323323
layer: the layer number.
324324
size: (width, height) tuple giving the region size."""
325325
if layer != 0:
326-
raise ValueError("Invalid layer")
326+
raise OpenSlideError("Invalid layer")
327327
for s in size:
328328
if s <= 0:
329-
raise ValueError("Size must be positive")
329+
raise OpenSlideError("Size must be positive")
330330
# Any corner of the requested region may be outside the bounds of
331331
# the image. Create a transparent tile of the correct size and
332332
# paste the valid part of the region into the correct location.

0 commit comments

Comments
 (0)