summaryrefslogtreecommitdiff
path: root/nrepl-client.el
diff options
context:
space:
mode:
authorsanjayl <sanjay.linganna@gmail.com>2016-04-04 00:30:28 -0400
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2016-04-04 07:30:28 +0300
commitfaba0fe732bff3bd36dc3717e75429cf0c3b95ac (patch)
tree01ef622bbe07c1cb0bd8225dcf3e62774b79d9f6 /nrepl-client.el
parentff1f1078ab8f2cc8dadae2265ce68974dddbdb50 (diff)
Mute user-specified middleware errors
Suppress user-specified middleware errors
Diffstat (limited to 'nrepl-client.el')
-rw-r--r--nrepl-client.el21
1 files changed, 9 insertions, 12 deletions
diff --git a/nrepl-client.el b/nrepl-client.el
index 641c9f1f..e1e8f05a 100644
--- a/nrepl-client.el
+++ b/nrepl-client.el
@@ -962,18 +962,15 @@ sign of user input, so as not to hang the interface."
(accept-process-output nil 0.01))
;; If we couldn't finish, return nil.
(when (member "done" status)
- (when-let ((ex (nrepl-dict-get response "ex"))
- (err (nrepl-dict-get response "err")))
- ;; non-eval requests currently don't set the *e var
- ;; which is required by the stacktrace middleware
- ;; so we have to handle them differently until this is resolved
- (if (member "eval-error" status)
- (funcall nrepl-err-handler)
- (cider--render-stacktrace-causes (nrepl-dict-get response "pp-stacktrace"))))
- (when-let ((id (nrepl-dict-get response "id")))
- (with-current-buffer connection
- (nrepl--mark-id-completed id)))
- response)))
+ (nrepl-dbind-response response (ex err eval-error pp-stacktrace id)
+ (when (and ex err)
+ (cond (eval-error (funcall nrepl-err-handler))
+ (pp-stacktrace (cider--render-stacktrace-causes
+ pp-stacktrace (remove "done" status))))) ;; send the error type
+ (when id
+ (with-current-buffer connection
+ (nrepl--mark-id-completed id)))
+ response))))
(defun nrepl-request:stdin (input callback connection session)
"Send a :stdin request with INPUT using CONNECTION and SESSION.