Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilProfileTransformer.cs
===================================================================
diff -u -r9f9b40be8a207b1d4ff944bee747f472a64077a7 -r38940fd430501da3c19ac8c90f660b21f8938909
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilProfileTransformer.cs (.../MacroStabilityInwardsSoilProfileTransformer.cs) (revision 9f9b40be8a207b1d4ff944bee747f472a64077a7)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilProfileTransformer.cs (.../MacroStabilityInwardsSoilProfileTransformer.cs) (revision 38940fd430501da3c19ac8c90f660b21f8938909)
@@ -20,7 +20,6 @@
// All rights reserved.
using System;
-using System.Collections.Generic;
using System.Linq;
using Ringtoets.Common.IO.Exceptions;
using Ringtoets.Common.IO.SoilProfile;
@@ -90,8 +89,7 @@
}
catch (ArgumentException e)
{
- string message = CreateErrorMessage(soilProfile.Name, e.Message);
- throw new ImportedDataTransformException(message, e);
+ throw new ImportedDataTransformException(e.Message, e);
}
}
@@ -111,41 +109,14 @@
soilProfile.Layers
.Select(MacroStabilityInwardsSoilLayerTransformer.Transform)
.ToArray(),
- TransformPreconsolidationStresses(soilProfile.Name, soilProfile.PreconsolidationStresses));
+ soilProfile.PreconsolidationStresses
+ .Select(MacroStabilityInwardsPreconsolidationStressTransformer.Transform)
+ .ToArray());
}
catch (ArgumentException e)
{
- string message = CreateErrorMessage(soilProfile.Name, e.Message);
- throw new ImportedDataTransformException(message, e);
+ throw new ImportedDataTransformException(e.Message, e);
}
}
-
- ///
- /// Transforms the generic collection of into a .
- ///
- /// The name of the soil profile.
- /// The collection of to transform.
- /// An based on .
- /// Thrown when the
- /// could not be transformed into valid .
- private static IEnumerable TransformPreconsolidationStresses(string soilProfileName,
- IEnumerable preconsolidationStresses)
- {
- try
- {
- return preconsolidationStresses.Select(MacroStabilityInwardsPreconsolidationStressTransformer.Transform)
- .ToArray();
- }
- catch (ImportedDataTransformException e)
- {
- string message = CreateErrorMessage(soilProfileName, e.Message);
- throw new ImportedDataTransformException(message, e);
- }
- }
-
- private static string CreateErrorMessage(string soilProfileName, string errorMessage)
- {
- return string.Format(RingtoetsCommonIOResources.Transform_Error_occurred_when_transforming_SoilProfile_0_ErrorMessage_1_, soilProfileName, errorMessage);
- }
}
}
\ No newline at end of file