mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Removed the forced ERROR status when a block fails (except for Request and CF Bypass blocks).
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user