Skip to content

Commit

Permalink
fix(HandlerChecker): improve executing multiple handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed May 24, 2023
1 parent fbe8b5c commit 6db54d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/PollinationSDK/Helper/HandlerChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ public object CheckWithHandlers(object inputData, List<IOAliasHandler> handlers)
//Exception err = null;
try
{
handled = CheckWithHandler(inputData, item, out var newData);
var inData = checkedData ?? inputData; // use the checked data from the previous handler's output if it is available.
handled = CheckWithHandler(inData, item, out var newData);
checkedData = newData;
}
catch (Exception e)
{
Helper.Logger?.Error(e, $"PollinationSDK: error.");
errors.Add($"Handler-{item.Language}-{item.Function}: {e?.Message}");
errors.Add($"{e?.Message}{Environment.NewLine}From {item.Function}(Handler-{item.Language})");
break;
//throw;
}
}
Expand Down

0 comments on commit 6db54d0

Please sign in to comment.