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();

                if (_detector.IsDebugCall())
                {
                    _writer.RedirectToUrl(_trace.LogUrl);
                }
            }
        }
Exemplo n.º 2
0
        private void write()
        {
            if (!_detector.IsDebugCall())
            {
                return;
            }
            _report.MarkFinished();

            var debugWriter  = new DebugWriter(_report, _urls);
            var outputWriter = new HttpResponseOutputWriter();

            outputWriter.Write(MimeType.Html.ToString(), debugWriter.Write().ToString());
        }
Exemplo n.º 3
0
        private void write()
        {
            _report.MarkFinished();

            if (!_detector.IsDebugCall())
            {
                return;
            }

            _detector.UnlatchWriting();

            _debugCallHandler.Handle();
        }
Exemplo n.º 4
0
        private void invoke(Action action)
        {
            _report.StartBehavior(_inner);

            try
            {
                action();
            }
            catch (Exception ex)
            {
                _report.MarkException(ex);
                if (!_debugDetector.IsDebugCall())
                {
                    throw;
                }
            }

            _report.EndBehavior();
        }
Exemplo n.º 5
0
 public RecordingOutputWriter(IDebugDetector detector, IDebugReport report)
 {
     _report = report;
     _inner = detector.IsDebugCall() ? (IOutputWriter)new NulloOutputWriter() : new HttpResponseOutputWriter();
 }
 public DebuggingOutputWriter(IDebugDetector detector, IDebugReport report)
 {
     _inner = detector.IsDebugCall() ? (IOutputWriter) new RecordingOutputWriter(report) : new HttpResponseOutputWriter();
 }
Exemplo n.º 7
0
 public DebuggingOutputWriter(IDebugDetector detector, IDebugReport report)
 {
     _inner = detector.IsDebugCall() ? (IOutputWriter) new RecordingOutputWriter(report) : new HttpResponseOutputWriter();
 }
Exemplo n.º 8
0
 public RecordingOutputWriter(IDebugDetector detector, IDebugReport report)
 {
     _report = report;
     _inner  = detector.IsDebugCall() ? (IOutputWriter) new NulloOutputWriter() : new HttpResponseOutputWriter();
 }