Skip to content

Commit c132951

Browse files
r0manbbatsov
authored andcommitted
Use analyze-last-stacktrace and handle notifications
1 parent 0da71dd commit c132951

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cider-eval.el

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,10 @@ op/situation that originated this error."
482482
If RESPONSE contains a cause, cons it onto CAUSES and return that. If
483483
RESPONSE is the final message (i.e. it contains a status), render CAUSES
484484
into a new error buffer."
485-
(nrepl-dbind-response response (class status)
486-
(cond (class (cons response causes))
485+
(nrepl-dbind-response response (class msg status type)
486+
(cond ((and (member "notification" status) causes)
487+
(nrepl-notify msg type))
488+
(class (cons response causes))
487489
(status (cider--render-stacktrace-causes causes)))))
488490

489491
(defun cider-default-err-op-handler ()
@@ -493,7 +495,7 @@ into a new error buffer."
493495
(cider-nrepl-send-request
494496
(thread-last
495497
(map-merge 'list
496-
'(("op" "stacktrace"))
498+
'(("op" "analyze-last-stacktrace"))
497499
(cider--nrepl-print-request-map fill-column))
498500
(seq-mapcat #'identity))
499501
(lambda (response)
@@ -505,8 +507,10 @@ into a new error buffer."
505507
(defun cider-default-err-handler ()
506508
"This function determines how the error buffer is shown.
507509
It delegates the actual error content to the eval or op handler."
508-
(cond ((cider-nrepl-op-supported-p "stacktrace") (cider-default-err-op-handler))
509-
((cider-library-present-p "clojure.stacktrace") (cider-default-err-eval-handler))
510+
(cond ((cider-nrepl-op-supported-p "analyze-last-stacktrace")
511+
(cider-default-err-op-handler))
512+
((cider-library-present-p "clojure.stacktrace")
513+
(cider-default-err-eval-handler))
510514
(t (cider-default-err-eval-print-handler))))
511515

512516

0 commit comments

Comments
 (0)