Add ErrorAction to RecActionDto and batch error handling

Introduce ErrorAction property to RecActionDto for per-action error handling. Update InvokeRecActionsCommandHandler to check invocation results and use ErrorAction to determine whether to continue or stop on failure, enabling configurable batch processing behavior.

Add ErrorAction to RecActionDto and batch error handling

Introduce ErrorAction property to RecActionDto for per-action error handling. Update InvokeRecActionsCommandHandler to check invocation results and use ErrorAction to determine whether to continue or stop processing on failure. This enables configurable error handling in batch action execution.
This commit is contained in:
2025-12-12 01:52:35 +01:00
parent 030dcf8b58
commit 35171add0c
2 changed files with 13 additions and 1 deletions

View File

@@ -62,6 +62,8 @@ public record RecActionDto
public string? PostprocessingQuery { get; init; }
public string? ErrorAction { get; init; }
public UriBuilder ToEndpointUriBuilder()
{
var builder = EndpointUri is null ? new UriBuilder() : new UriBuilder(EndpointUri);

View File

@@ -18,6 +18,16 @@ public class InvokeRecActionsCommandHandler(ISender sender) : IRequestHandler<In
var actions = await sender.Send(request.ToReadQuery(q => q.Invoked = false), cancel);
foreach (var action in actions)
await sender.Send(action.ToInvokeCommand(), cancel);
{
var ok = await sender.Send(action.ToInvokeCommand(), cancel);
if (!ok)
switch (action.ErrorAction?.ToLowerInvariant())
{
case "continue":
break;
default:
return;
}
}
}
}