Use Atom::onWillThrowError to handle errors instead of ugly window.onerror hack.