public void Execute() { if (_firstAction == null) { throw new InvalidOperationException("_firstAction is not set"); } try { _circuitBreaker.ExecuteAction(() => { _firstAction.Invoke(); }); return; } catch (Exception ex) { if (_secondAction == null) { return; } _secondAction.Invoke(); _eventLogger.Exception(ex.Message + ex.InnerException?.Message + ex.StackTrace + ex.InnerException?.StackTrace); } }
private void TrackException(Exception ex) { this._circuitBreakerStateStore.Trip(ex); _eventLogger.Exception(ex.Message + ex.StackTrace); }