Make selenium raise an exception when a javascript error is detected on the page