From ef34e84e59eb3c9eccea876e685b2815f58505ed Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Wed, 31 Aug 2022 14:07:01 +0200 Subject: [PATCH] better location info in error, #33 --- resources/public/html/local.html | 22 +++++++++++++--------- src/scittle/core.cljs | 9 ++++----- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/resources/public/html/local.html b/resources/public/html/local.html index 868d48c..1d37726 100644 --- a/resources/public/html/local.html +++ b/resources/public/html/local.html @@ -5,18 +5,22 @@ diff --git a/src/scittle/core.cljs b/src/scittle/core.cljs index aa342cd..a19a314 100644 --- a/src/scittle/core.cljs +++ b/src/scittle/core.cljs @@ -30,7 +30,9 @@ 'random-uuid random-uuid 'read-string (sci/copy-var read-string rns)} 'goog.object {'set gobject/set - 'get gobject/get}}) + 'get gobject/get} + 'sci.core {'stacktrace sci/stacktrace + 'format-stacktrace sci/format-stacktrace}}) (def !sci-ctx (atom (sci/init {:namespaces namespaces @@ -56,10 +58,7 @@ (try (-eval-string s) (catch :default e (error/error-handler e (:src @!sci-ctx)) - (let [sci-error? (isa? (:type (ex-data e)) :sci/error)] - (throw (if sci-error? - (or (ex-cause e) e) - e)))))) + (throw e)))) (defn register-plugin! [plug-in-name sci-opts] plug-in-name ;; unused for now