From 95471f36a7e55b9cc9f2452be6de7ef9875560d2 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 23 Jan 2021 14:53:43 -0600 Subject: [PATCH] better error msg --- src/pixie/images.nim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pixie/images.nim b/src/pixie/images.nim index 3e36cac..c306180 100644 --- a/src/pixie/images.nim +++ b/src/pixie/images.nim @@ -121,9 +121,15 @@ proc subImage*(image: Image, x, y, w, h: int): Image = ## Gets a sub image from this image. if x < 0 or x + w > image.width: - raise newException(PixieError, "Param x value " & $x & " is out of bounds") + raise newException( + PixieError, + "Params x: " & $x & " w: " & $w & " invalid, image width is " & $image.width + ) if y < 0 or y + h > image.height: - raise newException(PixieError, "Param y value " & $y & " is out of bounds") + raise newException( + PixieError, + "Params y: " & $y & " h: " & $h & " invalid, image height is " & $image.height + ) result = newImage(w, h) for y2 in 0 ..< h: