Skip to content

Commit

Permalink
Merge pull request #8186 from blink1073/slow-kernel-start-2
Browse files Browse the repository at this point in the history
[Backport] Clean up kernel startup error messages
  • Loading branch information
Steven Silvester committed Apr 8, 2020
2 parents 5a195b5 + 03b003e commit 16a652c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
2 changes: 2 additions & 0 deletions docs/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

collect_ignore = ["build/html/genindex.html", "build/html/search.html", "build/html/index.html"]
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"display_github": True, # Integrate GitHub
"github_user": "jupyterlab", # Username
"github_repo": "jupyterlab", # Repo name
"github_version": "master", # Version
"github_version": "1.2.x", # Version
"conf_py_path": "/docs/source/", # Path in the checkout to the docs root
}

Expand Down
49 changes: 29 additions & 20 deletions packages/apputils/src/clientsession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -704,28 +704,37 @@ export class ClientSession implements IClientSession {
/**
* Handle an error in session startup.
*/
private _handleSessionError(
private async _handleSessionError(
err: ServerConnection.ResponseError
): Promise<void> {
return err.response
.text()
.then(text => {
let message = err.message;
try {
message = JSON.parse(text)['traceback'];
} catch (err) {
// no-op
}
let dialog = (this._dialog = new Dialog({
title: 'Error Starting Kernel',
body: <pre>{message}</pre>,
buttons: [Dialog.okButton()]
}));
return dialog.launch();
})
.then(() => {
this._dialog = null;
});
let traceback = '';
let message = '';
try {
const json = await err.response.json();
traceback = json['traceback'];
message = json['message'];
} catch (err) {
// no-op
}
const body = (
<div>
<pre>{err.message}</pre>
{message && <pre>{message}</pre>}
{traceback && (
<details className="jp-mod-wide">
<pre>{traceback}</pre>
</details>
)}
</div>
);

const dialog = (this._dialog = new Dialog({
title: 'Error Starting Kernel',
body,
buttons: [Dialog.okButton()]
}));
await dialog.launch();
this._dialog = null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/apputils/style/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
padding-bottom: 12px;
min-width: 300px;
min-height: 150px;
max-width: 500px;
max-width: 1000px;
max-height: 500px;
box-sizing: border-box;
box-shadow: var(--jp-elevation-z20);
Expand Down
2 changes: 0 additions & 2 deletions scripts/ci_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ if [[ $GROUP == docs ]]; then
make html

# Remove internal sphinx files and use pytest-check-links on the generated html
rm build/html/genindex.html
rm build/html/search.html
py.test --check-links -k .html build/html || py.test --check-links -k .html --lf build/html

popd
Expand Down

0 comments on commit 16a652c

Please sign in to comment.