private void OnRawApiDataReceived(object sender, RawApiDataEventArgs e) { try { RawApiDataReceived?.Invoke(sender, e); } catch (Exception ex) { Log.Error($"Error dispatching raw api data for {e.Uri}", ex); } }
private void DispatchReceivedRawApiData(Uri uri, RestMessage restMessage) { // send RawFeedMessage if needed try { var args = new RawApiDataEventArgs(uri, restMessage); RawApiDataReceived?.Invoke(this, args); } catch (Exception e) { ExecutionLog.LogError($"Error dispatching raw message for {uri}", e); } // continue normal processing }
private void DispatchReceivedRawApiData(Uri uri, RestMessage restMessage, string requestParams, TimeSpan requestTime, string culture) { // send RawFeedMessage if needed try { var args = new RawApiDataEventArgs(uri, restMessage, requestParams, requestTime, culture); RawApiDataReceived?.Invoke(this, args); } catch (Exception e) { ExecutionLog.LogError(e, $"Error dispatching raw message for {uri}"); } // continue normal processing }
private void OnRawApiDataReceived(object sender, RawApiDataEventArgs e) { if (RawApiDataReceived == null) { return; } var timerOptionsOnRawApiDataReceived = new TimerOptions { Context = "FeedExt", Name = "OnRawApiDataReceived", MeasurementUnit = Unit.Items }; using var t = MetricsRoot.Measure.Timer.Time(timerOptionsOnRawApiDataReceived, $"{e.RestMessage?.GetType().Name} - {e.Language}"); try { RawApiDataReceived?.Invoke(sender, e); Log.LogInformation($"Dispatching raw api message for {e.Uri} took {t.Elapsed.TotalMilliseconds} ms."); } catch (Exception ex) { Log.LogError(ex, $"Error dispatching raw api data for {e.Uri}. Took {t.Elapsed.TotalMilliseconds} ms."); } }