Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show content emitted by kernel supervisor when it fails to connect #5983

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions extensions/positron-supervisor/src/KallichoreAdapterApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,23 @@ export class KCApi implements KallichoreAdapterApi {
continue;
} else {
// Give up; it shouldn't take this long to start
this._log.appendLine(`Kallichore server did not start after ${Date.now() - startTime}ms`);
throw new Error(`Kallichore server did not start after ${Date.now() - startTime}ms`);
let message = `Kallichore server did not start after ${Date.now() - startTime}ms`;
this._log.appendLine(message);

// The error that we're about to throw will show up in
// the Console. If there's any content in the log
// files, append it to the error message so that the
// user can see it without clicking over to the logs.
if (fs.existsSync(outFile)) {
// Note that we don't need to append this content
// to the lgos since the output file is already
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, lgos -> logs

// being watched by the log streamer.
const contents = fs.readFileSync(outFile, 'utf8');
if (contents) {
message += `; output:\n\n${contents}`;
}
}
throw new Error(message);
}
}

Expand Down
Loading