-
Notifications
You must be signed in to change notification settings - Fork 300
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
Display python error message when kernel dies #7646
Conversation
// Show the error message | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
void this.applicationShell.showErrorMessage( | ||
exc instanceof Error ? exc.message : (exc as any).toString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaner than displaying a to string version of the error.
@@ -245,9 +245,7 @@ export class KernelExecution implements IDisposable { | |||
@captureTelemetry(Telemetry.RestartJupyterTime) | |||
private async restartExecution(notebook: INotebook): Promise<void> { | |||
// Just use the internal session. Pending cells should have been canceled by the caller | |||
await notebook.session.restart(this.interruptTimeout).catch((exc) => { | |||
traceWarning(`Error during restart: ${exc}`); | |||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug, we were swalling errors when restarting kernels, its as though everything went fine, when infact the kernel actually died.
const message = | ||
'exitCode' in options | ||
? `Kernel died with exit code ${options.exitCode}. ${options.reason}` | ||
? `Kernel died (code: ${options.exitCode}). ${reason}${options.reason}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to incldue error message in the first line (in python stack traces the error message is at the end, this way we extract the last line & put it on top of the error message)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it look like in the UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## main #7646 +/- ##
=====================================
Coverage 68% 68%
=====================================
Files 363 363
Lines 22546 22535 -11
Branches 3430 3431 +1
=====================================
- Hits 15490 15489 -1
+ Misses 5724 5715 -9
+ Partials 1332 1331 -1
|
Fixes #7318