Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs =================================================================== diff -u -rfff1d95ef2a08f34f16ac3f7870acc0a0c68eb83 -rb49aec40751eb5693981ed75a823b9993b9ab8ec --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs (.../MacroStabilityInwardsCalculationService.cs) (revision fff1d95ef2a08f34f16ac3f7870acc0a0c68eb83) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs (.../MacroStabilityInwardsCalculationService.cs) (revision b49aec40751eb5693981ed75a823b9993b9ab8ec) @@ -134,20 +134,18 @@ if (macroStabilityInwardsResult.CalculationMessages.Any(cm => cm.ResultType == UpliftVanKernelMessageType.Error)) { - CalculationServiceHelper.LogMessagesAsError(macroStabilityInwardsResult.CalculationMessages - .Where(cm => cm.ResultType == UpliftVanKernelMessageType.Error) - .Select(cm => cm.Message).ToArray()); + CalculationServiceHelper.LogMessagesAsError(new[] + { + CreateAggregatedLogMessage(Resources.MacroStabilityInwardsCalculationService_Calculate_Errors_in_MacroStabilityInwards_calculation, macroStabilityInwardsResult) + }); } else { if (macroStabilityInwardsResult.CalculationMessages.Any()) { CalculationServiceHelper.LogMessagesAsWarning(new[] { - Resources.MacroStabilityInwardsCalculationService_Calculate_Warnings_in_MacroStabilityInwards_calculation + Environment.NewLine + - macroStabilityInwardsResult.CalculationMessages - .Where(cm => cm.ResultType == UpliftVanKernelMessageType.Warning) - .Aggregate(string.Empty, (current, logMessage) => current + $"* {logMessage.Message}{Environment.NewLine}").Trim() + CreateAggregatedLogMessage(Resources.MacroStabilityInwardsCalculationService_Calculate_Warnings_in_MacroStabilityInwards_calculation, macroStabilityInwardsResult) }); } @@ -205,5 +203,13 @@ MaximumSliceWidth = inputParameters.MaximumSliceWidth }); } + + private static string CreateAggregatedLogMessage(string baseMessage, UpliftVanCalculatorResult macroStabilityInwardsResult) + { + return baseMessage + + Environment.NewLine + + macroStabilityInwardsResult.CalculationMessages + .Aggregate(string.Empty, (current, logMessage) => current + $"* {logMessage.Message}{Environment.NewLine}").Trim(); + } } } \ No newline at end of file