File tree Expand file tree Collapse file tree 4 files changed +7
-32
lines changed Expand file tree Collapse file tree 4 files changed +7
-32
lines changed Original file line number Diff line number Diff line change 69
69
:value (str (js* " eval(~{block})" ))}
70
70
(catch :default e
71
71
{:status :exception
72
- :ua-product (get-ua-product )
73
- :value (str e)
74
- :stacktrace
75
- (if (.hasOwnProperty e " stack" )
76
- (.-stack e)
77
- " No stacktrace available." )}))]
72
+ :value (cljs.repl/error->str e)}))]
78
73
(pr-str result)))
79
74
80
75
(defn send-result [connection url data]
Original file line number Diff line number Diff line change 148
148
{:status :success
149
149
:value (if-let [r (eval-str engine js)] (safe-to-string r) " " )}
150
150
(catch ScriptException e
151
- (let [^Throwable root-cause (clojure.stacktrace/root-cause e)]
152
- {:status :exception
153
- :value (.getMessage root-cause)
154
- :stacktrace
155
- (apply str
156
- (interpose " \n "
157
- (map #(subs % 5 )
158
- (filter #(clojure.string/starts-with? % " <js>." )
159
- (map str
160
- (.getStackTrace root-cause))))))}))
151
+ {:status :exception
152
+ :value (eval-str engine " cljs.repl.error__GT_str(cljs.core._STAR_e)" )})
161
153
(catch Throwable e
162
154
(let [^Throwable root-cause (clojure.stacktrace/root-cause e)]
163
155
{:status :exception
164
- :value (.getMessage root-cause)
165
- :stacktrace
166
- (apply str
167
- (interpose " \n "
168
- (map str
169
- (.getStackTrace root-cause))))}))))
156
+ :value (cljs.repl/ex-str (cljs.repl/ex-triage (Throwable->map root-cause)))}))))
170
157
(-load [{engine :engine :as this} ns url]
171
158
(load-ns engine ns ))
172
159
(-tear-down [this]
Original file line number Diff line number Diff line change 138
138
(catch ScriptException e
139
139
(let [^Throwable root-cause (clojure.stacktrace/root-cause e)]
140
140
{:status :exception
141
- :value (.getMessage root-cause)
142
- :stacktrace (NashornException/getScriptStackString root-cause)}))
141
+ :value (eval-str engine " cljs.repl.error__GT_str(cljs.core._STAR_e)" )}))
143
142
(catch Throwable e
144
143
(let [^Throwable root-cause (clojure.stacktrace/root-cause e)]
145
144
{:status :exception
146
- :value (.getMessage root-cause)
147
- :stacktrace
148
- (apply str
149
- (interpose " \n "
150
- (map str
151
- (.getStackTrace root-cause))))}))))
145
+ :value (cljs.repl/ex-str (cljs.repl/ex-triage (Throwable->map root-cause)))}))))
152
146
(-load [{engine :engine :as this} ns url]
153
147
(load-ns engine ns ))
154
148
(-tear-down [this]
Original file line number Diff line number Diff line change 86
86
(ScriptableObject/putProperty top-level " _STAR_e"
87
87
(Context/javaToJS ex scope))
88
88
{:status :exception
89
- :value (.toString ex)
90
- :stacktrace (stacktrace ex)}))))
89
+ :value (cljs.repl/ex-str (cljs.repl/ex-triage (Throwable->map ex)))}))))
91
90
92
91
(defn load-file
93
92
" Load a JavaScript. This is needed to load JavaScript files before the Rhino
You can’t perform that action at this time.
0 commit comments