Catch exceptions on test page

Summary: This makes typing into the box bearable with break-on-exception enabled.

Test Plan: Typed into box; I didn't blow up.

Reviewers: emily

Reviewed By: emily

Subscribers: jessie

Differential Revision: http://phabricator.khanacademy.org/D13314
This commit is contained in:
Ben Alpert 2014-09-22 11:46:26 -07:00
parent d2f41a19a5
commit 317564a173

View File

@ -27,7 +27,15 @@ function init() {
reprocess();
function reprocess() {
katex.render(input.value, math);
try {
katex.render(input.value, math);
} catch (e) {
if (e.__proto__ == katex.ParseError.prototype) {
console.error(e);
} else {
throw e;
}
}
}
}