Index: Ringtoets/Common/src/Ringtoets.Common.IO/Exceptions/DistributionValidationException.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.IO/Exceptions/DistributionValidationException.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Exceptions/DistributionValidationException.cs (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -0,0 +1,67 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace Ringtoets.Common.IO.Exceptions
+{
+ ///
+ /// Exception thrown when something went wrong when a distribution is invalid.
+ ///
+ [Serializable]
+ public class DistributionValidationException : Exception
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DistributionValidationException() {}
+
+ ///
+ /// Initializes a new instance of the class
+ /// with a specified error message.
+ ///
+ /// The message that describes the error.
+ public DistributionValidationException(string message) : base(message) {}
+
+ ///
+ /// Initializes a new instance of the class with a specified error message
+ /// and a reference to the inner exception that is the cause of this exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// The exception that is the cause of the current exception,
+ /// or null if no inner exception is specified.
+ public DistributionValidationException(string message, Exception innerException) : base(message, innerException) {}
+
+ ///
+ /// Initializes a new instance of with
+ /// serialized data.
+ /// The that holds the serialized
+ /// object data about the exception being thrown.
+ /// The that contains contextual
+ /// information about the source or destination.
+ /// The parameter is
+ /// null.
+ /// The class name is null or
+ /// is zero (0).
+ protected DistributionValidationException(SerializationInfo info, StreamingContext context) : base(info, context) {}
+ }
+}
\ No newline at end of file
Fisheye: Tag 16655233702d8d9b12e8618a6b40acabe27aa1a7 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.IO/Exceptions/InvalidDistributionSettingException.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj
===================================================================
diff -u -r6ce47c27ad8dc0e84fdb290be480f5f66b61d8be -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision 6ce47c27ad8dc0e84fdb290be480f5f66b61d8be)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -45,7 +45,7 @@
-
+
Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs
===================================================================
diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/DistributionHelper.cs (.../DistributionHelper.cs) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -41,7 +41,7 @@
/// The name of the parameter to be validated.
/// Thrown when
/// is null.
- /// Thrown when the parameter is not a
+ /// Thrown when the parameter is not a
/// log normal distribution with a zero shift.
public static void ValidateLogNormalDistribution(long? distributionType, double shift, string parameterName)
{
@@ -53,15 +53,17 @@
if (distributionType.HasValue)
{
if (distributionType.Value != SoilLayerConstants.LogNormalDistributionValue)
- throw new InvalidDistributionSettingException(string.Format(
- Resources.Stochastic_parameter_0_must_be_a_lognormal_distribution,
- parameterName));
+ {
+ throw new DistributionValidationException(string.Format(
+ Resources.Stochastic_parameter_0_must_be_a_lognormal_distribution,
+ parameterName));
+ }
if (Math.Abs(shift) > tolerance)
{
- throw new InvalidDistributionSettingException(string.Format(
- Resources.Stochastic_parameter_0_must_be_a_lognormal_distribution_with_zero_shift,
- parameterName));
+ throw new DistributionValidationException(string.Format(
+ Resources.Stochastic_parameter_0_must_be_a_lognormal_distribution_with_zero_shift,
+ parameterName));
}
}
}
@@ -73,7 +75,7 @@
/// The name of the parameter to be validated.
/// Thrown when
/// is null.
- /// Thrown when the parameter is not a
+ /// Thrown when the parameter is not a
/// log normal distribution.
public static void ValidateShiftedLogNormalDistribution(long? distributionType, string parameterName)
{
@@ -84,9 +86,9 @@
if (distributionType.HasValue && distributionType != SoilLayerConstants.LogNormalDistributionValue)
{
- throw new InvalidDistributionSettingException(string.Format(
- Resources.Stochastic_parameter_0_has_no_shifted_lognormal_distribution,
- parameterName));
+ throw new DistributionValidationException(string.Format(
+ Resources.Stochastic_parameter_0_has_no_shifted_lognormal_distribution,
+ parameterName));
}
}
}
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Exceptions/DistributionValidationExceptionTest.cs
===================================================================
diff -u
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Exceptions/DistributionValidationExceptionTest.cs (revision 0)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Exceptions/DistributionValidationExceptionTest.cs (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -0,0 +1,32 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Core.Common.TestUtil;
+using NUnit.Framework;
+using Ringtoets.Common.IO.Exceptions;
+
+namespace Ringtoets.Common.IO.Test.Exceptions
+{
+ [TestFixture]
+ public class DistributionValidationExceptionTest :
+ CustomExceptionDesignGuidelinesTestFixture {}
+}
\ No newline at end of file
Fisheye: Tag 16655233702d8d9b12e8618a6b40acabe27aa1a7 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.IO.Test/Exceptions/InvalidDistributionSettingExceptionTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj
===================================================================
diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj (.../Ringtoets.Common.IO.Test.csproj) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj (.../Ringtoets.Common.IO.Test.csproj) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -79,7 +79,7 @@
-
+
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs
===================================================================
diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs (.../DistributionHelperTest.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/DistributionHelperTest.cs (.../DistributionHelperTest.cs) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -48,7 +48,7 @@
}
[Test]
- public void ValidateLogNormalDistribution_InvalidDistributionType_ThrowsInvalidDistributionSettingException()
+ public void ValidateLogNormalDistribution_InvalidDistributionType_ThrowsDistributionValidationException()
{
// Setup
const long distributionType = -1;
@@ -63,12 +63,12 @@
parameterName);
// Assert
- var exception = Assert.Throws(call);
+ var exception = Assert.Throws(call);
Assert.AreEqual($"Parameter '{parameterName}' moet lognormaal verdeeld zijn.", exception.Message);
}
[Test]
- public void ValidateLogNormalDistribution_ShiftNonZero_ThrowsInvalidDistributionSettingException()
+ public void ValidateLogNormalDistribution_ShiftNonZero_ThrowsDistributionValidationException()
{
// Setup
const long distributionType = SoilLayerConstants.LogNormalDistributionValue;
@@ -83,7 +83,7 @@
parameterName);
// Assert
- var exception = Assert.Throws(call);
+ var exception = Assert.Throws(call);
Assert.AreEqual($"Parameter '{parameterName}' moet lognormaal verdeeld zijn met een verschuiving gelijk aan 0.", exception.Message);
}
@@ -137,7 +137,7 @@
}
[Test]
- public void ValidateShiftedLogNormalDistribution_InvalidDistributionType_ThrowsInvalidDistributionSettingException()
+ public void ValidateShiftedLogNormalDistribution_InvalidDistributionType_ThrowsDistributionValidationException()
{
// Setup
const long invalidDistributionType = -1;
@@ -148,7 +148,7 @@
parameterName);
// Assert
- var exception = Assert.Throws(call);
+ var exception = Assert.Throws(call);
Assert.AreEqual($"Parameter '{parameterName}' moet verschoven lognormaal verdeeld zijn.", exception.Message);
}
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformer.cs
===================================================================
diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformer.cs (.../MacroStabilityInwardsPreconsolidationStressTransformer.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsPreconsolidationStressTransformer.cs (.../MacroStabilityInwardsPreconsolidationStressTransformer.cs) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -61,7 +61,9 @@
try
{
- ValidateDistribution(preconsolidationStress);
+ DistributionHelper.ValidateLogNormalDistribution(preconsolidationStress.StressDistributionType,
+ preconsolidationStress.StressShift,
+ Resources.PreconsolidationStress_DisplayName);
var distribution = new VariationCoefficientLogNormalDistribution
{
@@ -71,16 +73,11 @@
return new MacroStabilityInwardsPreconsolidationStress(location, distribution);
}
- catch (InvalidDistributionSettingException e)
+ catch (Exception e) when (e is DistributionValidationException || e is ArgumentOutOfRangeException)
{
string errorMessage = CreateErrorMessage(location, e.Message);
throw new ImportedDataTransformException(errorMessage, e);
}
- catch (ArgumentOutOfRangeException e)
- {
- string errorMessage = CreateErrorMessage(location, e.Message);
- throw new ImportedDataTransformException(errorMessage, e);
- }
catch (ArgumentException e)
{
throw new ImportedDataTransformException(e.Message, e);
@@ -93,19 +90,5 @@
location,
errorMessage);
}
-
- ///
- /// Validates whether the values of the
- /// are correct for creating the log normal distribution of a preconsolidation stress.
- ///
- /// The to validate.
- /// Thrown when the stochastic parameters
- /// are not defined as a log normal distribution.
- private static void ValidateDistribution(PreconsolidationStress preconsolidationStress)
- {
- DistributionHelper.ValidateLogNormalDistribution(preconsolidationStress.StressDistributionType,
- preconsolidationStress.StressShift,
- Resources.PreconsolidationStress_DisplayName);
- }
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilLayerTransformer.cs
===================================================================
diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilLayerTransformer.cs (.../MacroStabilityInwardsSoilLayerTransformer.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilLayerTransformer.cs (.../MacroStabilityInwardsSoilLayerTransformer.cs) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -201,11 +201,11 @@
}
catch (ArgumentOutOfRangeException e)
{
- string exceptionMessage = string.Format(Resources.Transform_Error_occurred_when_transforming_SoilLayer_0_for_Parameter_1_ErrorMessage_2_,
- soilLayerName,
- parameterName,
- e.Message);
- throw new ImportedDataTransformException(exceptionMessage, e);
+ string errorMessage = string.Format(Resources.Transform_Error_occurred_when_transforming_SoilLayer_0_for_Parameter_1_ErrorMessage_2_,
+ soilLayerName,
+ parameterName,
+ e.Message);
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
@@ -226,10 +226,10 @@
}
catch (NotSupportedException e)
{
- string exceptionMessage = CreateErrorMessage(soilLayerName,
- string.Format(RingtoetsCommonIOResources.Transform_Invalid_value_ParameterName_0,
- RingtoetsCommonIOResources.SoilLayerData_IsAquifer_DisplayName));
- throw new ImportedDataTransformException(exceptionMessage, e);
+ string errorMessage = CreateErrorMessage(soilLayerName,
+ string.Format(RingtoetsCommonIOResources.Transform_Invalid_value_ParameterName_0,
+ RingtoetsCommonIOResources.SoilLayerData_IsAquifer_DisplayName));
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
@@ -254,10 +254,10 @@
return false;
}
- string exceptionMessage = CreateErrorMessage(soilLayerName,
- string.Format(RingtoetsCommonIOResources.Transform_Invalid_value_ParameterName_0,
- Resources.SoilLayerData_UsePop_Description));
- throw new ImportedDataTransformException(exceptionMessage);
+ string errorMessage = CreateErrorMessage(soilLayerName,
+ string.Format(RingtoetsCommonIOResources.Transform_Invalid_value_ParameterName_0,
+ Resources.SoilLayerData_UsePop_Description));
+ throw new ImportedDataTransformException(errorMessage);
}
///
@@ -286,20 +286,20 @@
return MacroStabilityInwardsShearStrengthModel.CPhiOrSuCalculated;
}
- string exceptionMessage;
+ string errorMessage;
if (Math.Abs(shearStrengthModel.Value - 1) < tolerance)
{
- exceptionMessage = CreateErrorMessage(soilLayerName,
- Resources.MacroStabilityInwardsSoilLayerTransformer_TransformShearStrengthModel_No_MacroStabilityInwardsShearStrengthModel);
+ errorMessage = CreateErrorMessage(soilLayerName,
+ Resources.MacroStabilityInwardsSoilLayerTransformer_TransformShearStrengthModel_No_MacroStabilityInwardsShearStrengthModel);
}
else
{
- exceptionMessage = CreateErrorMessage(soilLayerName,
- string.Format(RingtoetsCommonIOResources.Transform_Invalid_value_ParameterName_0,
- Resources.SoilLayerData_ShearStrengthModel_Description));
+ errorMessage = CreateErrorMessage(soilLayerName,
+ string.Format(RingtoetsCommonIOResources.Transform_Invalid_value_ParameterName_0,
+ Resources.SoilLayerData_ShearStrengthModel_Description));
}
- throw new ImportedDataTransformException(exceptionMessage);
+ throw new ImportedDataTransformException(errorMessage);
}
///
@@ -318,9 +318,9 @@
}
catch (ArgumentException e)
{
- string exceptionMessage = CreateErrorMessage(soilLayerName,
- Resources.MacroStabilityInwardsSoilLayerTransformer_TransformSegmentToRing_Invalid_geometry_for_Ring);
- throw new ImportedDataTransformException(exceptionMessage, e);
+ string errorMessage = CreateErrorMessage(soilLayerName,
+ Resources.MacroStabilityInwardsSoilLayerTransformer_TransformSegmentToRing_Invalid_geometry_for_Ring);
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
@@ -367,10 +367,10 @@
soilLayer.PopShift,
Resources.SoilLayerData_PopDistribution_DisplayName);
}
- catch (InvalidDistributionSettingException e)
+ catch (DistributionValidationException e)
{
- string exceptionMessage = CreateErrorMessage(soilLayer.MaterialName, e.Message);
- throw new ImportedDataTransformException(exceptionMessage, e);
+ string errorMessage = CreateErrorMessage(soilLayer.MaterialName, e.Message);
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilProfileTransformer.cs
===================================================================
diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilProfileTransformer.cs (.../MacroStabilityInwardsSoilProfileTransformer.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsSoilProfileTransformer.cs (.../MacroStabilityInwardsSoilProfileTransformer.cs) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -63,11 +63,11 @@
return Transform(soilProfile2D);
}
- string message = string.Format(RingtoetsCommonIOResources.SoilProfileTransformer_Cannot_tranform_Type_0_Only_types_Type_1_and_Type_2_are_supported,
- soilProfile.GetType().Name,
- nameof(SoilProfile1D),
- nameof(SoilProfile2D));
- throw new ImportedDataTransformException(message);
+ string errorMessage = string.Format(RingtoetsCommonIOResources.SoilProfileTransformer_Cannot_tranform_Type_0_Only_types_Type_1_and_Type_2_are_supported,
+ soilProfile.GetType().Name,
+ nameof(SoilProfile1D),
+ nameof(SoilProfile2D));
+ throw new ImportedDataTransformException(errorMessage);
}
///
@@ -90,8 +90,8 @@
}
catch (ArgumentException e)
{
- string message = CreateErrorMessage(soilProfile.Name, e.Message);
- throw new ImportedDataTransformException(message, e);
+ string errorMessage = CreateErrorMessage(soilProfile.Name, e.Message);
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
@@ -115,8 +115,8 @@
}
catch (ArgumentException e)
{
- string message = CreateErrorMessage(soilProfile.Name, e.Message);
- throw new ImportedDataTransformException(message, e);
+ string errorMessage = CreateErrorMessage(soilProfile.Name, e.Message);
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
@@ -138,8 +138,8 @@
}
catch (ImportedDataTransformException e)
{
- string message = CreateErrorMessage(soilProfileName, e.Message);
- throw new ImportedDataTransformException(message, e);
+ string errorMessage = CreateErrorMessage(soilProfileName, e.Message);
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilLayerTransformer.cs
===================================================================
diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilLayerTransformer.cs (.../PipingSoilLayerTransformer.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilLayerTransformer.cs (.../PipingSoilLayerTransformer.cs) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -172,10 +172,10 @@
soilLayer.PermeabilityShift,
Resources.SoilLayer_PermeabilityDistribution_DisplayName);
}
- catch (InvalidDistributionSettingException e)
+ catch (DistributionValidationException e)
{
- string errorMessage = CreateExceptionMessage(soilLayer.MaterialName,
- e.Message);
+ string errorMessage = CreateErrorMessage(soilLayer.MaterialName,
+ e.Message);
throw new ImportedDataTransformException(errorMessage, e);
}
}
@@ -247,14 +247,14 @@
Segment2D[] segment2Ds = loop.ToArray();
if (segment2Ds.Any(segment => IsVerticalAtX(segment, atX)))
{
- string message = CreateExceptionMessage(soilLayerName,
- string.Format(Resources.Error_Can_not_determine_1D_profile_with_vertical_segments_at_X_0_, atX));
- throw new ImportedDataTransformException(message);
+ string errorMessage = CreateErrorMessage(soilLayerName,
+ string.Format(Resources.Error_Can_not_determine_1D_profile_with_vertical_segments_at_X_0_, atX));
+ throw new ImportedDataTransformException(errorMessage);
}
return Math2D.SegmentsIntersectionWithVerticalLine(segment2Ds, atX).Select(p => p.Y);
}
- private static string CreateExceptionMessage(string soilLayerName, string errorMessage)
+ private static string CreateErrorMessage(string soilLayerName, string errorMessage)
{
return string.Format(RingtoetsCommonIOResources.Transform_Error_occurred_when_transforming_SoilLayer_0_ErrorMessage_1_,
soilLayerName,
@@ -283,10 +283,10 @@
}
catch (NotSupportedException e)
{
- string message = CreateExceptionMessage(soilLayerName,
- string.Format(RingtoetsCommonIOResources.Transform_Invalid_value_ParameterName_0,
- RingtoetsCommonIOResources.SoilLayerData_IsAquifer_DisplayName));
- throw new ImportedDataTransformException(message, e);
+ string errorMessage = CreateErrorMessage(soilLayerName,
+ string.Format(RingtoetsCommonIOResources.Transform_Invalid_value_ParameterName_0,
+ RingtoetsCommonIOResources.SoilLayerData_IsAquifer_DisplayName));
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilProfileTransformer.cs
===================================================================
diff -u -r117a54dfd9b5972086a1f3386923edda2e7a334b -r16655233702d8d9b12e8618a6b40acabe27aa1a7
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilProfileTransformer.cs (.../PipingSoilProfileTransformer.cs) (revision 117a54dfd9b5972086a1f3386923edda2e7a334b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfiles/PipingSoilProfileTransformer.cs (.../PipingSoilProfileTransformer.cs) (revision 16655233702d8d9b12e8618a6b40acabe27aa1a7)
@@ -63,11 +63,11 @@
return CreatePipingSoilProfile(soilProfile2D);
}
- string message = string.Format(RingtoetsCommonIOResources.SoilProfileTransformer_Cannot_tranform_Type_0_Only_types_Type_1_and_Type_2_are_supported,
- soilProfile.GetType().Name,
- nameof(SoilProfile1D),
- nameof(SoilProfile2D));
- throw new ImportedDataTransformException(message);
+ string errorMessage = string.Format(RingtoetsCommonIOResources.SoilProfileTransformer_Cannot_tranform_Type_0_Only_types_Type_1_and_Type_2_are_supported,
+ soilProfile.GetType().Name,
+ nameof(SoilProfile1D),
+ nameof(SoilProfile2D));
+ throw new ImportedDataTransformException(errorMessage);
}
///
@@ -112,8 +112,8 @@
}
catch (ArgumentException e)
{
- string message = CreateErrorMessage(soilProfile2D.Name, e.Message);
- throw new ImportedDataTransformException(message, e);
+ string errorMessage = CreateErrorMessage(soilProfile2D.Name, e.Message);
+ throw new ImportedDataTransformException(errorMessage, e);
}
}
@@ -137,8 +137,8 @@
}
catch (ArgumentException e)
{
- string message = CreateErrorMessage(soilProfile1D.Name, e.Message);
- throw new ImportedDataTransformException(message, e);
+ string errorMessage = CreateErrorMessage(soilProfile1D.Name, e.Message);
+ throw new ImportedDataTransformException(errorMessage, e);
}
}