public static string[] GetExceptionLines(Exception except, params string[] additional)
{
var lines = new List<string>
{
String.Format("Exception: '{0}' | '{1}'", except.TargetSite, except.Source),
except.Message,
except.StackTrace
};
lines.AddRange(additional);
if (except.InnerException != null)
{
lines.AddRange(GetExceptionLines(except.InnerException));
}
return lines.ToArray();
}