catch and show javascript errors on loading edit pages