onerror should be handled for CORS errors