File tree 1 file changed +11
-8
lines changed
src/cider/nrepl/middleware
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -284,15 +284,18 @@ this map (identified by a key), and will `dissoc` it afterwards."}
284
284
:rendered pr-str)))
285
285
286
286
(defn- debug-stacktrace
287
- " Create a dummy exception, send its stack."
288
- []
287
+ " Send the stacktrace of `value` if it is an exception.
288
+ Otherwise, create a dummy exception to view the call stack at the current location."
289
+ [value]
289
290
(debugger-send
290
291
{:status :stack
291
- :causes [{:class " StackTrace"
292
- :message " Harmless user-requested stacktrace"
293
- :stacktrace (-> (Exception. " Dummy" )
294
- (stacktrace.analyzer/analyze (::print/print-fn *msg*))
295
- last :stacktrace )}]}))
292
+ :causes (if (instance? Throwable value)
293
+ (stacktrace.analyzer/analyze value (::print/print-fn *msg*))
294
+ [{:class " StackTrace"
295
+ :message " Harmless user-requested stacktrace"
296
+ :stacktrace (-> (Exception. " Dummy" )
297
+ (stacktrace.analyzer/analyze (::print/print-fn *msg*))
298
+ last :stacktrace )}])}))
296
299
297
300
(def debug-commands
298
301
" An unsorted set of commands supported by the debugger."
@@ -365,7 +368,7 @@ this map (identified by a key), and will `dissoc` it afterwards."}
365
368
value)
366
369
:here (do (skip-breaks! :before coord (:code dbg-state) force?)
367
370
value)
368
- :stacktrace (do (debug-stacktrace )
371
+ :stacktrace (do (debug-stacktrace value )
369
372
(recur value dbg-state))
370
373
:trace (do (skip-breaks! :trace )
371
374
value)
You can’t perform that action at this time.
0 commit comments