Skip to content

Commit

Permalink
Changed on error suppress behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mvSapphire committed Jul 3, 2024
1 parent 2b75ff3 commit 4df2e2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/PowerPipe/Builder/Steps/InternalStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,15 @@ public async ValueTask ExecuteAsync(TContext context, CancellationToken cancella

ErrorHandledSucceed = await HandleExceptionAsync(context, cancellationToken);

if (!ErrorHandledSucceed.Value)
if (ErrorHandledSucceed.Value)
{
if (NextStep is not null)
await NextStep.ExecuteAsync(context, cancellationToken);
}
else
{
throw new PipelineExecutionException(e);
}
}
finally
{
Expand Down
8 changes: 5 additions & 3 deletions src/PowerPipe/Builder/Steps/LazyStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ internal LazyStep(Func<IStepBase<TContext>> factory, ILoggerFactory loggerFactor
if (instance is IPipelineStep<TContext> step)
step.NextStep = NextStep;

Logger = loggerFactory?.CreateLogger(instance.GetType());
var instanceType = instance.GetType();

Logger = loggerFactory?.CreateLogger(instanceType);

Logger?.LogDebug("{Step} executing", instanceType.FullName);

return instance;
});
Expand All @@ -45,7 +49,5 @@ protected override async ValueTask ExecuteInternalAsync(TContext context, Cancel
StepExecuted = true;

await _step.Value.ExecuteAsync(context, cancellationToken);

Logger?.LogDebug("{Step} executed", _step.Value.GetType().FullName);
}
}

0 comments on commit 4df2e2a

Please sign in to comment.