Skip to content

Commit 4d57a10

Browse files
committed
Improve error message when selected thread is not stopped
Fixes #325
1 parent 67d3dfc commit 4d57a10

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dap-mode.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ thread exection but the server will log message."
575575
(dap--resp-handler)
576576
debug-session)
577577
(dap--resume-application debug-session))
578-
(lsp--error "There is no stopped thread?")))
578+
(lsp--error "Currently active thread is not stopped. Use `dap-switch-thread' or select stopped thread from sessions view.")))
579579

580580
(defun dap-disconnect (session)
581581
"Disconnect from the currently active session."
@@ -601,7 +601,7 @@ thread exection but the server will log message."
601601
(dap--resp-handler)
602602
debug-session)
603603
(dap--resume-application debug-session))
604-
(lsp--error "There is no stopped thread?"))))
604+
(lsp--error "Currently active thread is not stopped. Use `dap-switch-thread' or select stopped thread from sessions view."))))
605605

606606
(defun dap-step-in ()
607607
"Debug step in."
@@ -614,7 +614,7 @@ thread exection but the server will log message."
614614
(dap--resp-handler)
615615
(dap--cur-active-session-or-die))
616616
(dap--resume-application (dap--cur-active-session-or-die)))
617-
(lsp--error "There is no stopped thread?")))
617+
(lsp--error "Currently active thread is not stopped. Use `dap-switch-thread' or select stopped thread from sessions view.")))
618618

619619
(defun dap-step-out ()
620620
"Debug step in."
@@ -627,7 +627,7 @@ thread exection but the server will log message."
627627
(dap--resp-handler)
628628
(dap--cur-active-session-or-die))
629629
(dap--resume-application (dap--cur-active-session-or-die)))
630-
(lsp--error "There is no stopped thread?")))
630+
(lsp--error "Currently active thread is not stopped. Use `dap-switch-thread' or select stopped thread from sessions view.")))
631631

632632
(defun dap-restart-frame (debug-session frame-id)
633633
"Restarts current frame."
@@ -647,7 +647,7 @@ thread exection but the server will log message."
647647
(progn
648648
(when (dap--session-running debug-session)
649649
(message "Disconnecting from %s" (dap--debug-session-name debug-session))
650-
(dap-disconnect))
650+
(dap-disconnect debug-session))
651651
(dap-debug (dap--debug-session-launch-args debug-session)))
652652
(user-error "There is session to restart")))
653653

0 commit comments

Comments
 (0)