private static void WriteExceptionInformation(string identifier, Exception exception)
{
try
{
if (exception == null)
{
return;
}
var path = Path.GetFullPath(Path.Combine(StackTracePath, string.Format ("{0}", identifier)));
var exceptionType = exception.GetType ();
string message = exceptionType.Name + ": " + exception.Message;
File.WriteAllText(path, string.Join(Environment.NewLine, exceptionType.FullName, message, exception.StackTrace));
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine (string.Format ("Failed to write managed exception information: {0}", ex.Message));
}
}