private void HandleException(Exception e)
{
try
{
string crashID = Guid.NewGuid().ToString();
String filename = String.Format(CultureInfo.InvariantCulture, "{0}{1}.log", HockeyConstants.CrashFilePrefix, crashID);
CrashLogInformation logInfo = new CrashLogInformation()
{
PackageName = Application.Current.GetType().Namespace,
Version = HockeyClient.Current.AsInternal().VersionInfo,
OperatingSystem = Environment.OSVersion.Platform.ToString(),
Windows = Environment.OSVersion.Version.ToString() + Environment.OSVersion.ServicePack,
Manufacturer = "",
Model = ""
};
ICrashData crash = HockeyClient.Current.AsInternal().CreateCrashData(e, logInfo);
using (FileStream stream = File.Create(Path.Combine(HockeyConstants.GetPathToHockeyCrashes(), filename)))
{
crash.Serialize(stream);
stream.Flush();
}
}
catch (Exception ex)
{
HockeyClient.Current.AsInternal().HandleInternalUnhandledException(ex);
}
}