IObservable <ProgressState> OnPublishRepository(object arg) { var newRepository = GatherRepositoryInfo(); var account = SelectedAccount; return(repositoryPublishService.PublishRepository(newRepository, account, SelectedHost.ApiClient) .Do(_ => usageTracker.IncrementPublishCount()) .Select(_ => ProgressState.Success) .Catch <ProgressState, Exception>(ex => { if (!ex.IsCriticalException()) { log.Error(ex); var error = new PublishRepositoryUserError(ex.Message); notificationService.ShowError((error.ErrorMessage + Environment.NewLine + error.ErrorCauseOrResolution).TrimEnd()); } return Observable.Return(ProgressState.Fail); })); }
public Task IncrementPublishCount() => inner.IncrementPublishCount();