use window.onerror to catch parse exceptions