Fix `commitFiles` error handling