Skip to content

Commit

Permalink
Session now exits when there is a runtime failure when running withou…
Browse files Browse the repository at this point in the history
…t debugging (#1103)

Fixes #1082
  • Loading branch information
idavis authored Feb 2, 2024
1 parent 00feaf6 commit c608f31
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions vscode/src/debugger/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,20 @@ export class QscDebugSession extends LoggingDebugSession {
// This will be replaced when the interpreter
// supports shots.
for (let i = 0; i < args.shots; i++) {
const result = await this.debugService.evalContinue(
bps,
this.eventTarget,
);
if (result.id != StepResultId.Return) {
await this.endSession(`execution didn't run to completion`, -1);
try {
const result = await this.debugService.evalContinue(
bps,
this.eventTarget,
);
if (result.id != StepResultId.Return) {
await this.endSession(`execution didn't run to completion`, -1);
return;
}
} catch (e) {
await this.endSession(`ending session due to error: ${e}`, 1);
return;
}

this.writeToDebugConsole(`Finished shot ${i + 1} of ${args.shots}`);
// Reset the interpreter for the next shot.
// The interactive interpreter doesn't do this automatically,
Expand Down

0 comments on commit c608f31

Please sign in to comment.