static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
{
if (e.ExceptionObject != null)
_events.Add ("UnhandledException:" + e.ExceptionObject + " | " + e.IsTerminating);
else
_events.Add ("UnhandledException");
using (StreamWriter sw = new StreamWriter (_exceptionFile, false, Encoding.UTF8)) {
sw.Write (e.ExceptionObject.ToString ());
}
}
}