mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Merge pull request #3621 from minrk/htmlerror
catch any exception appending output HTML output can have javascript with errors, etc. No output should ever raise, no matter what. closes #3620
This commit is contained in:
commit
f395271e95
@ -318,7 +318,19 @@ var IPython = (function (IPython) {
|
||||
toinsert.find('div.prompt').addClass('output_prompt').html('Out[' + n + ']:');
|
||||
}
|
||||
this.append_mime_type(json, toinsert, dynamic);
|
||||
this.element.append(toinsert);
|
||||
try {
|
||||
this.element.append(toinsert);
|
||||
} catch(err) {
|
||||
console.log("Error attaching output!");
|
||||
console.log(err);
|
||||
this.element.show();
|
||||
toinsert.html($('<div/>')
|
||||
.html("Javascript error adding output!<br/>" +
|
||||
err.toString() +
|
||||
'<br/>See your browser Javascript console for more details.')
|
||||
.addClass('js-error')
|
||||
);
|
||||
}
|
||||
// If we just output latex, typeset it.
|
||||
if ((json.latex !== undefined) || (json.html !== undefined)) {
|
||||
this.typeset();
|
||||
|
Loading…
Reference in New Issue
Block a user