protected override void invoke(Action action)
        {
            _logger.DebugMessage(() => new BehaviorStart(_correlation));

            try
            {
                action();
                _logger.DebugMessage(() => new BehaviorFinish(_correlation));
            }
            catch (Exception ex)
            {
                if (!_exceptionObserver.WasObserved(ex))
                {
                    _logger.DebugMessage(() =>
                    {
                        var log = new BehaviorFinish(_correlation);
                        log.LogException(ex);

                        return(log);
                    });

                    _exceptionObserver.RecordHandled(ex);
                }

                throw;
            }
        }
Esempio n. 2
0
        protected override void invoke(Action action)
        {
            _trace.Start();

            try
            {
                action();
            }
            catch (Exception ex)
            {
                _trace.MarkAsFailedRequest();

                if (!_exceptionObserver.WasObserved(ex))
                {
                    _trace.Log(new ExceptionReport("Request failed", ex));
                    _exceptionObserver.RecordHandled(ex);
                }

                throw;
            }
            finally
            {
                _trace.MarkFinished();
            }
        }
Esempio n. 3
0
        protected override void invoke(Action action)
        {
            _trace.Log(new BehaviorStart(_correlation));

            try
            {
                action();

                _trace.Log(new BehaviorFinish(_correlation));
            }
            catch (Exception ex)
            {
                if (!_exceptionObserver.WasObserved(ex))
                {
                    var log = new BehaviorFinish(_correlation);
                    log.LogException(ex);
                    _trace.Log(log);
                }

                throw;
            }
        }