Improve error handling with RecActionException

Wrap exceptions in PreprocessingBehavior with RecActionException, including ActionId and ProfileId for better context and debugging. This enhances error reporting when ErrorAction is set to Stop.
This commit is contained in:
2026-03-25 09:57:46 +01:00
parent fec125b0d5
commit a14d5ff112

View File

@@ -1,4 +1,5 @@
using MediatR; using MediatR;
using ReC.Application.Common.Exceptions;
using ReC.Application.Common.Interfaces; using ReC.Application.Common.Interfaces;
using ReC.Application.RecActions.Commands; using ReC.Application.RecActions.Commands;
using ReC.Application.Results.Commands; using ReC.Application.Results.Commands;
@@ -33,7 +34,7 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip
}, cancel); }, cancel);
if (request.Action.ErrorAction == ErrorAction.Stop) if (request.Action.ErrorAction == ErrorAction.Stop)
throw; throw new RecActionException(request.Action.Id, request.Action.ProfileId, ex);
} }
return await next(cancel); return await next(cancel);