Skip to content

Commit

Permalink
fix: runner startup silent failure (#914)
Browse files Browse the repository at this point in the history
Closes #909

### Summary of Changes

- failing to start runner process now logs an appropriate message
informs the user via popup again
- command is now successfully passed to the runner component, if changed

---------

Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
  • Loading branch information
WinPlay02 and megalinter-bot authored Feb 22, 2024
1 parent a59c551 commit 8812944
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/safe-ds-lang/src/language/runner/safe-ds-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ export class SafeDsRunner {
this.logging.outputInfo(`Using safe-ds-runner version: ${versionString}`);
}
} catch (error) {
this.logging.outputError(`Could not start runner: ${error}`);
this.logging.displayError('The runner process could not be started.');
this.logging.outputError(`Could not start runner: ${error instanceof Error ? error.message : error}`);
this.logging.displayError(
`The runner process could not be started: ${error instanceof Error ? error.message : error}`,
);
return;
}
// Start the runner at the specified port
Expand Down Expand Up @@ -414,6 +416,9 @@ export class SafeDsRunner {
process.on('close', (code) => {
reject(new Error(`The subprocess shut down: ${code}`));
});
process.on('error', (err) => {
reject(new Error(`The subprocess could not be started (${err.message})`));
});
});
}

Expand Down
3 changes: 3 additions & 0 deletions packages/safe-ds-vscode/src/extension/mainClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ const registerVSCodeWatchers = function () {
if (event.affectsConfiguration('safe-ds.runner.command')) {
// Try starting runner
logOutput('Safe-DS Runner Command was updated');
services.runtime.Runner.updateRunnerCommand(
vscode.workspace.getConfiguration('safe-ds.runner').get<string>('command')!,
);
if (!services.runtime.Runner.isPythonServerAvailable()) {
services.runtime.Runner.startPythonServer();
} else {
Expand Down

0 comments on commit 8812944

Please sign in to comment.