added exception handler/dumper

This commit is contained in:
WeeXnes 2023-06-08 16:55:41 +02:00
parent 79dcc39826
commit 892cd40895
3 changed files with 17 additions and 2 deletions

View file

@ -17,9 +17,24 @@ namespace WeeXnes
/// </summary> /// </summary>
public partial class App public partial class App
{ {
private void SetExceptionHandler()
{
AppDomain currentDomain = default(AppDomain);
currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += GlobalUnhandledExceptionHandler;
}
private static void GlobalUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
{
Exception ex = (Exception)e.ExceptionObject;
using (StreamWriter writer = new StreamWriter("error_log.txt"))
{
writer.WriteLine(ex.ToString());
}
}
private void App_OnStartup(object sender, StartupEventArgs e) private void App_OnStartup(object sender, StartupEventArgs e)
{ {
Environment.CurrentDirectory = Application.StartupPath; Environment.CurrentDirectory = Application.StartupPath;
SetExceptionHandler();
CheckForDebugMode(); CheckForDebugMode();
CheckUpdatedFiles(); CheckUpdatedFiles();
CheckForFolder(); CheckForFolder();

View file

@ -8,7 +8,7 @@ namespace WeeXnes.Core
{ {
public class Information public class Information
{ {
public const string Version = "4.3.1"; public const string Version = "4.3.2";
public const string EncryptionHash = "8zf5#RdyQ]$4x4_"; public const string EncryptionHash = "8zf5#RdyQ]$4x4_";
public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest"; public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest";
} }

View file

@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Version>4.3.1</Version> <Version>4.3.2</Version>
<ProjectGuid>{4B33CEE7-C74D-43B9-B99A-8B273D5195BC}</ProjectGuid> <ProjectGuid>{4B33CEE7-C74D-43B9-B99A-8B273D5195BC}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>WeeXnes</RootNamespace> <RootNamespace>WeeXnes</RootNamespace>