From 2f5ebe85f7b38725b209335d45c7881afc056b45 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Thu, 2 Jun 2022 14:57:16 -0400 Subject: [PATCH] Improve error messages in processes --- src/ludus/interpreter.clj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ludus/interpreter.clj b/src/ludus/interpreter.clj index 1b43837..4d812fc 100644 --- a/src/ludus/interpreter.clj +++ b/src/ludus/interpreter.clj @@ -518,7 +518,8 @@ status (:status process)] (when (not (= :dead status)) (swap! process-atom #(assoc % :queue (conj q msg))) - ;;(println "sent" msg "to" (:pid process)) + (Thread/sleep 1) ;; this is terrible--but it avoids deadlock + ;;TODO: actually debug this? ) msg)) @@ -530,7 +531,9 @@ (future (try (interpret-ast expr ctx) (catch Exception e - (println "Panic in Ludus process" (str self ":") (ex-message e)))) + (println "Panic in Ludus process" (str self ":") (ex-message e)) + (pp/pprint (ex-data e)) + (println "On line" (get-in (ex-data e) [:ast :token ::token/line]) "in" (resolve-word :file ctx)))) (swap! @process #(assoc % :status :dead)))) pid))