Skip to content

Commit ac266e2

Browse files
committed
Handle closed connection on exit
1 parent 5e73b93 commit ac266e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cmsis-debug-session.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,11 @@ export class CmsisDebugSession extends GDBDebugSession {
361361
}
362362

363363
// Stop gdb client and server
364-
await this.gdb.sendGDBExit();
364+
try {
365+
await this.gdb.sendGDBExit();
366+
} catch (e) {
367+
// Need to catch here in case the connection has already been closed
368+
}
365369
this.gdbServer.kill();
366370
}
367371

0 commit comments

Comments
 (0)