From 0cd02856cc25025cfe06f25d7a3de794f1bd2916 Mon Sep 17 00:00:00 2001 From: oakes Date: Sun, 12 Jan 2014 23:13:05 -0500 Subject: [PATCH] Throw error when unsupported keyword is used --- src/play_clj/ui.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/play_clj/ui.clj b/src/play_clj/ui.clj index 1243f9d..b62ff0e 100644 --- a/src/play_clj/ui.clj +++ b/src/play_clj/ui.clj @@ -41,10 +41,10 @@ (defn cell! [^Cell cell & args] - (let [method-name (first args) + (let [method (first args) [[a1 a2 a3 a4] rest-args] (split-with #(not (keyword? %)) (rest args))] - (when method-name - (case method-name + (when method + (case method :width (.width cell ^double a1) :height (.height cell ^double a1) :size (.size cell ^double a1 ^double a2) @@ -82,7 +82,7 @@ :uniform-x (.uniformX cell) :uniform-y (.uniformY cell) :row (.row cell) - nil) + (throw (Exception. (str "The keyword " method " is not supported.")))) (apply cell! cell rest-args)) cell)) @@ -102,7 +102,7 @@ (keyword? child) (case child :row (.row ^Table (:object parent)) - nil))) + (throw (Exception. (str "The keyword " child " is not supported.")))))) (defn ^:private create-tree-node [child]