Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 44aea4a

Browse files
committed
add check for compiler crash
1 parent 0eb8055 commit 44aea4a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

UI/MainWindow/MainWindowSPCompiler.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,27 @@ await this.ShowMessageAsync(Program.Translations.GetLanguage("Error"),
195195
{
196196
process.Start();
197197
process.WaitForExit();
198+
199+
if (process.ExitCode is not 1 or 0)
200+
{
201+
await progressTask.CloseAsync();
202+
await this.ShowMessageAsync(Program.Translations.GetLanguage("Error"),
203+
"The SourcePawn compiler has crashed.\n" +
204+
"Try again, or file an issue at the SourcePawn GitHub repository describing your steps that lead to this instance in detail.\n" +
205+
$"Exit code: {process.ExitCode}", MessageDialogStyle.Affirmative,
206+
MetroDialogOptions);
207+
LoggingControl.LogAction($"Compiler crash detected, file: {fileInfo.Name}", 2);
208+
InCompiling = false;
209+
return;
210+
}
198211
}
199212
catch (Exception)
200213
{
201214
await progressTask.CloseAsync();
202215
await this.ShowMessageAsync(Program.Translations.GetLanguage("SPCompNotStarted"),
203216
Program.Translations.GetLanguage("Error"), MessageDialogStyle.Affirmative,
204217
MetroDialogOptions);
218+
InCompiling = false;
205219
return;
206220
}
207221

0 commit comments

Comments
 (0)