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:
@@ -426,7 +426,6 @@ namespace OpenBullet
|
|||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Globals.LogError(Components.Stacker, $"Processing of line {BlockBase.TruncatePretty(vm.LS.CurrentLine, 20)} failed, exception: {ex.Message}");
|
Globals.LogError(Components.Stacker, $"Processing of line {BlockBase.TruncatePretty(vm.LS.CurrentLine, 20)} failed, exception: {ex.Message}");
|
||||||
vm.BotData.Status = BotStatus.ERROR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintBotData();
|
PrintBotData();
|
||||||
|
|||||||
@@ -229,17 +229,28 @@ namespace RuriLib.LS
|
|||||||
// If Block -> Process Block
|
// If Block -> Process Block
|
||||||
if (BlockParser.IsBlock(CurrentLine))
|
if (BlockParser.IsBlock(CurrentLine))
|
||||||
{
|
{
|
||||||
|
BlockBase block = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var block = BlockParser.Parse(CurrentLine);
|
block = BlockParser.Parse(CurrentLine);
|
||||||
CurrentBlock = block.Label;
|
CurrentBlock = block.Label;
|
||||||
if (!block.Disabled)
|
if (!block.Disabled)
|
||||||
block.Process(data);
|
block.Process(data);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
// We log the error message
|
||||||
data.LogBuffer.Add(new LogEntry("ERROR: " + ex.Message, Colors.Tomato));
|
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);
|
throw new BlockProcessingException(ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -689,7 +689,6 @@ namespace RuriLib.Runner
|
|||||||
if (Settings.General.BotsDisplayMode == BotsDisplayMode.Everything)
|
if (Settings.General.BotsDisplayMode == BotsDisplayMode.Everything)
|
||||||
bot.Status = $"<<< ERROR IN BLOCK: {loli.CurrentBlock} >>>";
|
bot.Status = $"<<< ERROR IN BLOCK: {loli.CurrentBlock} >>>";
|
||||||
RaiseMessageArrived(LogLevel.Error, $"[{bot.Id}] ERROR in block {loli.CurrentBlock} | Exception: {ex.Message}", false);
|
RaiseMessageArrived(LogLevel.Error, $"[{bot.Id}] ERROR in block {loli.CurrentBlock} | Exception: {ex.Message}", false);
|
||||||
botData.Status = BotStatus.ERROR;
|
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
Reference in New Issue
Block a user