Use RecActionException for contextual error handling

Replaced generic exception with RecActionException in PostprocessingBehavior when ErrorAction is Stop, providing ActionId and ProfileId for better error context. Added necessary using statements for the new exception and related namespaces.
This commit is contained in:
2026-03-25 09:58:02 +01:00
parent a14d5ff112
commit 30ccf05c57

View File

@@ -1,4 +1,5 @@
using MediatR;
using ReC.Application.Common.Exceptions;
using ReC.Application.Common.Interfaces;
using ReC.Application.RecActions.Commands;
using ReC.Application.Results.Commands;
@@ -38,7 +39,7 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi
}, cancel);
if (request.Action.ErrorAction == ErrorAction.Stop)
throw;
throw new RecActionException(request.Action.Id, request.Action.ProfileId, ex);
}
return Unit.Value;