Wrap interpret in try/catch for more graceful panics

This commit is contained in:
Scott Richmond 2022-04-25 19:08:05 -04:00
parent f7809d5ddf
commit 6d81175b37

View File

@ -331,7 +331,13 @@
(throw (ex-info "Unknown AST node type" {:node ast}))))
(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