From 0365b33993812361936e81104f793f58794fde8f Mon Sep 17 00:00:00 2001 From: RogueAI42 Date: Sat, 17 Jun 2017 19:45:21 +1000 Subject: Added exception handling to MindBlow --- ShiftOS.WinForms/Applications/MindBlow.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Applications/MindBlow.cs b/ShiftOS.WinForms/Applications/MindBlow.cs index 22f5011..0f0df80 100644 --- a/ShiftOS.WinForms/Applications/MindBlow.cs +++ b/ShiftOS.WinForms/Applications/MindBlow.cs @@ -160,8 +160,15 @@ namespace ShiftOS.WinForms.Applications { new Thread(() => { - Interpreter.Reset(); - Interpreter.Execute(programinput.Text); + try + { + Interpreter.Reset(); + Interpreter.Execute(programinput.Text); + } + catch (Exception ex) + { + Desktop.InvokeOnWorkerThread(() => Infobox.Show("Program Error", "An error occurred while executing your program: " + ex.GetType().ToString())); + } }).Start(); } -- cgit v1.2.3