i have service which working on cron expresions
public Task DoProcessAsync()
{
return transactionService.CommitAsync(() => DoProcess());
}
private async Task DoProcess()
{
try{...}
catch{logger.logError("error");}
}
But i know that block try catch in this place i not good, because Commit will accepted. Also i have
public Task Start()
{
exportCron = CronExtensions
.Cron(sheduleConfiguration.SetCitiesCronExpression)
.Select(x => Observable.FromAsync(() => setCitiesToClientsService.DoProcessAsync()))
.Concat()
.Subscribe();
return Task.FromResult(0);
}
So maybe i can place method catch() to this extension? If it is yes, how can i do this?
I've found
.Subscribe(onNext => { }, onError => { logger.LogError("Error"); } );
But sequnce had stopped working after error, but must continue. There are some propositions?