I have this code at the bottom of Plugin.cs in my plugin.
Code: Select all
public override void HookException(Exception e) {
Logging.LogException(e);
System.Windows.Forms.MessageBox.Show(LanThis, "There was an error with the Anesthesia plugin. Please contact Big Idea Software at 817-807-1709 or copy the text of the crash and email it to helpdesk@bigideasoft.com. Error: " + e.ToString());
}Code: Select all
using System;
using System.IO;
namespace Anesthesia {
internal class Logging {
public static string LogDirectory="AnesthLogs";
internal static void LogException(Exception e) {
string errorText = @"\r\n" + @"\r\n"+
"Error Message: " +e.Message+"\r\nStack Trace:\r\n"+e.StackTrace+"\r\nTime of Occurrence: "+DateTime.Now
+"\r\n-----------------------------------------------------------------------------------------\r\n";
try {
if(!Directory.Exists(LogDirectory)) {
Directory.CreateDirectory(LogDirectory);
}
string path=LogDirectory+"//"+DateTime.Today.ToString("MM-dd-yyyy")+".log";
File.AppendAllText(path,errorText);
}
catch {
//Do nothing
}
}
}
}Did something change in the OD code for handling crashes recently?