Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle the exceptional case here

  • Loading branch information...
commit 21edf777ac70c56f5a08fe8c1cbc2cf2f3372d42 1 parent f9e741b
@hiredman authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 clojurebot-eval/src/clojurebot/eval.clj
View
5 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
Please sign in to comment.
Something went wrong with that request. Please try again.