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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user