Skip to content

Commit

Permalink
show an error message when the kernel is dead
Browse files Browse the repository at this point in the history
  • Loading branch information
akhmerov committed Oct 19, 2020
1 parent 4e308de commit fc1a992
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/thebelab.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,16 @@ function renderCell(element, options) {
events.trigger("request-kernel");
}
kernelPromise.then((kernel) => {
outputArea.future = kernel.requestExecute({ code: code });
try {
outputArea.future = kernel.requestExecute({ code: code });
} catch (error) {
outputArea.model.clear();
outputArea.model.add({
output_type: "stream",
name: "stderr",
text: `Failed to execute. ${error} Please refresh the page.`,
});
}
});
return false;
}
Expand Down

0 comments on commit fc1a992

Please sign in to comment.