Better handling of upload errors