summaryrefslogtreecommitdiff
path: root/chess-pgn.el
diff options
context:
space:
mode:
Diffstat (limited to 'chess-pgn.el')
-rw-r--r--chess-pgn.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/chess-pgn.el b/chess-pgn.el
index 9d0ebf5..67ec901 100644
--- a/chess-pgn.el
+++ b/chess-pgn.el
@@ -11,6 +11,10 @@
(defvar chess-pgn-fill-column 60)
+(chess-message-catalog 'english
+ '((pgn-read-error . "Error reading move: %s")
+ (pgn-parse-error . "Error parsing PGN syntax")))
+
(defun chess-pgn-read-plies (game position &optional top-level)
(let ((plies (list t)) prevpos done)
(while (not (or done (eobp)))
@@ -23,7 +27,7 @@
(let* ((move (match-string 0))
(ply (chess-algebraic-to-ply position (match-string 0))))
(unless ply
- (error "Error reading move: %s" move))
+ (chess-error 'pgn-read-error move))
(setq position (chess-ply-next-pos ply))
(nconc plies (list ply))))
((and top-level
@@ -49,7 +53,7 @@
(looking-at ")"))
(forward-char)
(setq done t))
- (t (error "Error parsing PGN syntax")))
+ (t (chess-error 'pgn-parse-error)))
(skip-chars-forward " \t\n"))
(cdr plies)))