public async Task MoveToErrors(Envelope envelope, Exception exception) { var errorReport = new ErrorReport(envelope, exception); try { await _persistor.MoveToDeadLetterStorage(new[] { errorReport }); } catch (Exception e) { _logger.LogException(e); _retries.LogErrorReport(errorReport); } }
private async Task logErrorReports(ErrorReport[] errors) { if (!_settings.PersistDeadLetterEnvelopes) { return; } try { await _persistor.MoveToDeadLetterStorage(errors); ErrorReportLogged.Set(); } catch (Exception e) { _logger.LogException(e); foreach (var error in errors) { LogErrorReport(error); } } }