Wrap interpret in try/catch for more graceful panics
This commit is contained in:
parent
f7809d5ddf
commit
6d81175b37
|
@ -331,7 +331,13 @@
|
||||||
(throw (ex-info "Unknown AST node type" {:node ast}))))
|
(throw (ex-info "Unknown AST node type" {:node ast}))))
|
||||||
|
|
||||||
(defn interpret [parsed]
|
(defn interpret [parsed]
|
||||||
(interpret-ast (::parser/ast parsed) {}))
|
(try
|
||||||
|
(interpret-ast (::parser/ast parsed) {})
|
||||||
|
(catch clojure.lang.ExceptionInfo e
|
||||||
|
(println "Ludus panicked!")
|
||||||
|
(println (ex-message e))
|
||||||
|
(pp/pprint (ex-data e))
|
||||||
|
(System/exit 67))))
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user