Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsStochasticSoilProfileTransformer.cs
===================================================================
diff -u -rec201316303aa676976655dcdfd9285dcc3ec4f1 -r30baf70ea42def18e66d1ec3c71aa0e54a89229a
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsStochasticSoilProfileTransformer.cs (.../MacroStabilityInwardsStochasticSoilProfileTransformer.cs) (revision ec201316303aa676976655dcdfd9285dcc3ec4f1)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsStochasticSoilProfileTransformer.cs (.../MacroStabilityInwardsStochasticSoilProfileTransformer.cs) (revision 30baf70ea42def18e66d1ec3c71aa0e54a89229a)
@@ -20,9 +20,9 @@
// All rights reserved.
using System;
+using Ringtoets.Common.IO.Exceptions;
using Ringtoets.Common.IO.SoilProfile;
using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
-using Ringtoets.MacroStabilityInwards.Primitives;
namespace Ringtoets.MacroStabilityInwards.IO.SoilProfiles
{
@@ -41,6 +41,8 @@
/// The transformed soil profile.
/// A new based on the given data.
/// Thrown when any parameter is null.
+ /// Thrown when
+ /// could not be transformed.
public static MacroStabilityInwardsStochasticSoilProfile Transform(StochasticSoilProfile stochasticSoilProfile,
IMacroStabilityInwardsSoilProfile soilProfile)
{
@@ -53,7 +55,14 @@
throw new ArgumentNullException(nameof(soilProfile));
}
- return new MacroStabilityInwardsStochasticSoilProfile(stochasticSoilProfile.Probability, soilProfile);
+ try
+ {
+ return new MacroStabilityInwardsStochasticSoilProfile(stochasticSoilProfile.Probability, soilProfile);
+ }
+ catch (ArgumentOutOfRangeException e)
+ {
+ throw new ImportedDataTransformException(e.Message, e);
+ }
}
}
}
\ No newline at end of file