Scalien.ExceptionStackTrace.GetStackTraceFileInfo C# (CSharp) Method

GetStackTraceFileInfo() private static method

private static GetStackTraceFileInfo ( Exception exception ) : int>.Tuple
exception System.Exception
return int>.Tuple
        private static Tuple<string, int> GetStackTraceFileInfo(Exception exception)
        {
            var trace = new StackTrace(exception, true);

            // Find the first frame with valid file name
            int firstFrame = Array.FindIndex(trace.GetFrames(), f => f.GetFileName() != null);

            if (firstFrame < 0)
                firstFrame = 0;

            StackFrame frame = trace.GetFrame(firstFrame);

            return new Tuple<string, int>(frame.GetFileName() ?? "", frame.GetFileLineNumber());
        }