improve error messages caused by CORS failures