Skip to content

Commit 2c4347e

Browse files
committed
Added global exception handling to analyse occasional crashes when not used
1 parent c0856db commit 2c4347e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

MiniWebCompiler/Program.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,18 @@ public static int Main(string[] args)
3838
Environment.Exit(1);
3939
}
4040

41-
var app = new App();
42-
app.InitializeComponent();
43-
app.Run();
44-
45-
return 0;
41+
try
42+
{
43+
var app = new App();
44+
app.InitializeComponent();
45+
app.Run();
46+
return 0;
47+
}
48+
catch (Exception ex)
49+
{
50+
MessageBox.Show("An unexpected error has occurred.\n" + ex.ToString(), "Mini Web Compiler Error", MessageBoxButton.OK, MessageBoxImage.Error);
51+
return 1;
52+
}
4653
}
4754

4855
private static async Task<int> CloseRunningInstance()

0 commit comments

Comments
 (0)