Improve client side javascript error logging