Skip to content

Commit 33e649b

Browse files
Rahixjo-m
authored andcommitted
include limit values in rect size error messages
As a user, it is nice to know what the limit is when an error about exceeding said limit is shown.
1 parent f055b44 commit 33e649b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/trainbot/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ func parseCheckArgs() config {
9999

100100
r := c.getRect()
101101
if r.Size().X < rectSizeMin || r.Size().Y < rectSizeMin {
102-
p.Fail("rect is too small")
102+
p.Fail(fmt.Sprintf("rect is too small (minimum width and height is %d px)", rectSizeMin))
103103
}
104104
if r.Size().X > rectSizeMax || r.Size().Y > rectSizeMax {
105-
p.Fail("rect is too large")
105+
p.Fail(fmt.Sprintf("rect is too large (maximum width and height is %d px)", rectSizeMax))
106106
}
107107

108108
return c

0 commit comments

Comments
 (0)