Skip to content

Commit

Permalink
Improve user-error on missing live connections
Browse files Browse the repository at this point in the history
  • Loading branch information
svaante committed Oct 7, 2024
1 parent cd20e1e commit a228d19
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions dape.el
Original file line number Diff line number Diff line change
Expand Up @@ -1290,21 +1290,20 @@ See `dape--connection-selected'."
(reverse connections))))
(conn
(pcase type
('parent
(car connections))
('last
(seq-find 'dape--thread-id ordered))
('running
(seq-find (lambda (conn)
(and (dape--thread-id conn)
(not (dape--stopped-threads conn))))
ordered))
('stopped
(seq-find (lambda (conn)
(and (dape--stopped-threads conn)))
ordered)))))
('parent (car connections))
('last (seq-find #'dape--thread-id ordered))
('running (seq-find (lambda (conn)
(and (dape--thread-id conn)
(not (dape--stopped-threads conn))))
ordered))
('stopped (seq-find (lambda (conn)
(and (dape--stopped-threads conn)))
ordered)))))
(unless (or nowarn conn)
(user-error "No %s debug connection live" type))
(user-error "No %sdebug connection live"
;; `parent' and `last' does not make sense to the user
(if (memq type '(running stopped))
(format "%s " type) "")))
conn))

(defun dape--live-connections ()
Expand Down

0 comments on commit a228d19

Please sign in to comment.