www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 317564a173270d8b030ca322971289bbd7970f60
parent d2f41a19a5e9a68dd67df02d5998bc5ce81aed8e
Author: Ben Alpert <spicyjalapeno@gmail.com>
Date:   Mon, 22 Sep 2014 11:46:26 -0700

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

Diffstat:
Mstatic/main.js | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/static/main.js b/static/main.js @@ -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; + } + } } }