Exemplo n.º 1
0
        private IEnumerable <StackFrameSourceCodeInfo> GetStackFrames(Exception original)
        {
            var stackFrames = StackTraceHelper.GetFrames(original, out var exception)
                              .Select(frame => GetStackFrameSourceCodeInfo(
                                          frame.MethodDisplayInfo?.ToString(),
                                          frame.FilePath,
                                          frame.LineNumber));

            if (exception != null)
            {
                _logger?.FailedToReadStackTraceInfo(exception);
            }

            return(stackFrames);
        }
Exemplo n.º 2
0
        public IEnumerable <ExceptionDetails> GetDetails(Exception exception)
        {
            var exceptions = FlattenAndReverseExceptionTree(exception);

            foreach (var ex in exceptions)
            {
                yield return(new ExceptionDetails
                {
                    Error = ex,
                    StackFrames = StackTraceHelper.GetFrames(ex)
                                  .Select(frame => GetStackFrameSourceCodeInfo(
                                              frame.MethodDisplayInfo.ToString(),
                                              frame.FilePath,
                                              frame.LineNumber))
                });
            }
        }