Permalink
Browse files

handle the exceptional case here

  • Loading branch information...
1 parent f9e741b commit 21edf777ac70c56f5a08fe8c1cbc2cf2f3372d42 @hiredman committed Feb 25, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 clojurebot-eval/src/clojurebot/eval.clj
@@ -6,7 +6,10 @@
(defn handler* [{{:strs [expression befuddled]} :params :as m}]
(try
- (let [[stdout stderr result] (sb/eval-message expression (read-string befuddled))]
+ (let [r (sb/eval-message expression (read-string befuddled))
+ [stdout stderr result] (if (vector? r)
+ r
+ [nil r nil])]
{:status 200
:body (pr-str {:stdout stdout
:stderr stderr

0 comments on commit 21edf77

Please sign in to comment.