mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 20:20:40 +08:00
Handle process natural death a bit better
This commit is contained in:
committed by
Derek Parker
parent
f39e134d1d
commit
8b04d877a0
@ -87,9 +87,14 @@ func Run(run bool, pid int, args []string) {
|
||||
}
|
||||
|
||||
cmd := cmds.Find(cmdstr)
|
||||
err = cmd(dbp, args...)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Command failed: %s\n", err)
|
||||
if err := cmd(dbp, args...); err != nil {
|
||||
switch err.(type) {
|
||||
case proctl.ProcessExitedError:
|
||||
pe := err.(proctl.ProcessExitedError)
|
||||
fmt.Fprintf(os.Stderr, "Process exited with status %d\n", pe.Status)
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "Command failed: %s\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user