Add javascript error catcher