Skip to content

Commit

Permalink
Loading default message into validation exception so it will be more …
Browse files Browse the repository at this point in the history
…helpful downstream
  • Loading branch information
jasonmwebb-lv committed May 7, 2024
1 parent 1b8ea2d commit 2394f43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/RCommon.FluentValidation/FluentValidationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public async Task<ValidationOutcome> ValidateAsync<T>(T target, bool throwOnFaul
if (failures.Count != 0)
{
_logger.LogWarning("Validation errors - {CommandType} - Command: {@Command} - Errors: {@ValidationErrors}", target.GetGenericTypeName(), target, failures);
string message = $"Validation Errors for type {typeof(T).Name}";
string message = $"Validation Errors";

var faults = new List<ValidationFault>();
foreach (var failure in failures)
Expand All @@ -54,7 +54,7 @@ public async Task<ValidationOutcome> ValidateAsync<T>(T target, bool throwOnFaul

if (throwOnFaults)
{
throw new ApplicationServices.Validation.ValidationException(message, faults);
throw new ApplicationServices.Validation.ValidationException(message, faults, true);
}

}
Expand Down

0 comments on commit 2394f43

Please sign in to comment.