diff options
| author | troido <troido@hotmail.com> | 2018-01-02 23:35:47 +0100 |
|---|---|---|
| committer | troido <troido@hotmail.com> | 2018-01-02 23:35:47 +0100 |
| commit | 543f8693426358eda26decafc8cefa2cd2b698e3 (patch) | |
| tree | bb8a0a474078a0c2072e25451ea7f1eb25b21a5e | |
| parent | 44c26befaab94781e35d159db82d875bff2ed31e (diff) | |
catch all errors from prompted commands, and print them to the message log
| -rw-r--r-- | asciifarm/client/inputhandling.hy | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/asciifarm/client/inputhandling.hy b/asciifarm/client/inputhandling.hy index 8d19e4a..80043c9 100644 --- a/asciifarm/client/inputhandling.hy +++ b/asciifarm/client/inputhandling.hy @@ -35,7 +35,10 @@ [[key value] (.items (read-str commandsstring))]))) (defn runCommand [self commandstring] - (eval (read-str (+ "(" commandstring ")")))) + (try + (eval (read-str (+ "(" commandstring ")"))) + (except [e Exception] + (self.display.addMessage (repr e))))) (defn parseMessage [self message] (if message |
