aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Logging/ExtensionMethods/ExceptionExtensions.cs
blob: d3a824a900254a5cef5fa250c297f634efce59f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Logging
{
    /// <summary>
    /// Contains <see cref="Exception"/> exception methods.
    /// </summary>
    public 
/// Flattens the exception by digging on InnerException. /// </summary> /// <param name="exception">The exception.</param> /// <returns></returns> public static String FlattenException(this Exception exception) { var stringBuilder = new StringBuilder(); while (exception != null) { stringBuilder.AppendLine(exception.Message); stringBuilder.AppendLine(exception.StackTrace); exception = exception.InnerException; } return stringBuilder.ToString(); } } }