Catch javascript exceptions (triggered by failed assertions).