From 31d9ff02d544af371566eccf9470237ef0cd8b37 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 26 Sep 2024 11:11:14 +0200 Subject: [PATCH] Improve error message --- chess/board.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chess/board.go b/chess/board.go index c66e562..2ca3707 100644 --- a/chess/board.go +++ b/chess/board.go @@ -1334,11 +1334,11 @@ func getXY(position string) (int, int, error) { posY = runes[1] if posX < 'a' || posX > 'h' { - return -1, -1, fmt.Errorf("invalid move: %s", position) + return -1, -1, fmt.Errorf("square does not exist: %s", position) } if posY < '1' || posY > '8' { - return -1, -1, fmt.Errorf("invalid move: %s", position) + return -1, -1, fmt.Errorf("square does not exist: %s", position) } // image origin (0,0) is at top-left corner (a8)