summaryrefslogtreecommitdiff
path: root/chess-algebraic.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-09-01 03:46:41 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-09-01 05:05:16 -0400
commite02e36b9e62af44091cdf98c1ab4e153b5d55c82 (patch)
tree20614434849ff1d753d930d0f3ba041e9340e46e /chess-algebraic.el
parent2d588570a4a77246c33d025f8851c6c3ce2202b8 (diff)
Report a clearer error in the case of an algebraic queening move with an
unspecified promotion.
Diffstat (limited to 'chess-algebraic.el')
-rw-r--r--chess-algebraic.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/chess-algebraic.el b/chess-algebraic.el
index 89ca0a6..af2f898 100644
--- a/chess-algebraic.el
+++ b/chess-algebraic.el
@@ -120,11 +120,17 @@ This regexp handles both long and short form.")
(when changes
(when trust
(if mate
- (nconc changes (list (if (equal mate "#") :checkmate :check)))))
+ (nconc changes (list (if (equal mate "#")
+ :checkmate
+ :check)))))
(unless long-style
(nconc changes (list :san move)))
- (apply 'chess-ply-create position trust changes))))))
+ (condition-case err
+ (apply 'chess-ply-create position trust changes)
+ (error
+ (error "Error in algebraic move '%s': %s"
+ move (error-message-string err)))))))))
(defun chess-ply--move-text (ply long)
(or