diff --git a/OpenBullet/Pages/Main/Stacker.xaml.cs b/OpenBullet/Pages/Main/Stacker.xaml.cs index 81e6d96..e8fae31 100644 --- a/OpenBullet/Pages/Main/Stacker.xaml.cs +++ b/OpenBullet/Pages/Main/Stacker.xaml.cs @@ -426,7 +426,6 @@ namespace OpenBullet } catch (Exception ex) { Globals.LogError(Components.Stacker, $"Processing of line {BlockBase.TruncatePretty(vm.LS.CurrentLine, 20)} failed, exception: {ex.Message}"); - vm.BotData.Status = BotStatus.ERROR; } PrintBotData(); diff --git a/RuriLib/LoliScript/LoliScript.cs b/RuriLib/LoliScript/LoliScript.cs index b1d4a19..c5d2f49 100644 --- a/RuriLib/LoliScript/LoliScript.cs +++ b/RuriLib/LoliScript/LoliScript.cs @@ -229,17 +229,28 @@ namespace RuriLib.LS // If Block -> Process Block if (BlockParser.IsBlock(CurrentLine)) { + BlockBase block = null; try { - var block = BlockParser.Parse(CurrentLine); + block = BlockParser.Parse(CurrentLine); CurrentBlock = block.Label; if (!block.Disabled) block.Process(data); } catch (Exception ex) { + // We log the error message data.LogBuffer.Add(new LogEntry("ERROR: " + ex.Message, Colors.Tomato)); - data.Status = BotStatus.ERROR; + + // Stop the execution only if the block is vital for the execution of the script (requests) + // This way we prevent the interruption of the script and an endless retry cycle e.g. if we fail to parse a response given a specific input + if (block != null && ( + block.GetType() == typeof(BlockRequest) || + block.GetType() == typeof(BlockBypassCF))) + { + data.Status = BotStatus.ERROR; + } + throw new BlockProcessingException(ex.Message); } } diff --git a/RuriLib/Runner/RunnerViewModel.cs b/RuriLib/Runner/RunnerViewModel.cs index b0b7bc3..21db2ff 100644 --- a/RuriLib/Runner/RunnerViewModel.cs +++ b/RuriLib/Runner/RunnerViewModel.cs @@ -689,7 +689,6 @@ namespace RuriLib.Runner if (Settings.General.BotsDisplayMode == BotsDisplayMode.Everything) bot.Status = $"<<< ERROR IN BLOCK: {loli.CurrentBlock} >>>"; RaiseMessageArrived(LogLevel.Error, $"[{bot.Id}] ERROR in block {loli.CurrentBlock} | Exception: {ex.Message}", false); - botData.Status = BotStatus.ERROR; Thread.Sleep(1000); } catch (Exception ex)