Skip to content

Some logging #16670

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"theme": "light"
},
"engines": {
"vscode": "^1.101.0"
"vscode": "^1.100.0"
},
"l10n": "./l10n",
"extensionKind": [
Expand Down
19 changes: 18 additions & 1 deletion src/kernels/execution/cellExecutionMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,14 @@ export class CellExecutionMessageHandler implements IDisposable {
this.execution?.start(this.startTime);
logger.debug(`Kernel acknowledged execution of cell ${this.cell.index} @ ${this.startTime}`);
}
if (!msg.header) {
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
logger.warn(`Got a message without a header ${JSON.stringify(msg)}`);
} catch {
logger.warn(`Got a message without a header, no idea what it is`, msg);
}
}

// eslint-disable-next-line @typescript-eslint/no-require-imports
const jupyterLab = require('@jupyterlab/services') as typeof import('@jupyterlab/services');
Expand Down Expand Up @@ -527,7 +535,16 @@ export class CellExecutionMessageHandler implements IDisposable {
} else if (jupyterLab.KernelMessage.isCommCloseMsg(msg)) {
// Noop.
} else {
logger.warn(`Unknown message ${msg.header.msg_type} : hasData=${'data' in msg.content}`);
if (msg.header) {
logger.warn(`Unknown message ${msg.header.msg_type} : hasData=${'data' in msg.content}`);
} else {
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
logger.warn(`Unknown message ${JSON.stringify(msg)}`);
} catch {
logger.warn(`Unknown message, no idea what it is`, msg);
}
}
}

// Set execution count, all messages should have it
Expand Down