count the upload errors and exit with that status code