Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresFailureMechanismAssemblyFactory.cs =================================================================== diff -u -r4fc5b1e9f92137bc06cf948dc2652c8aa6c9297f -r5f22b93f12f13cf1c558e36f8ea9a4d4300a3744 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresFailureMechanismAssemblyFactory.cs (.../StabilityPointStructuresFailureMechanismAssemblyFactory.cs) (revision 4fc5b1e9f92137bc06cf948dc2652c8aa6c9297f) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresFailureMechanismAssemblyFactory.cs (.../StabilityPointStructuresFailureMechanismAssemblyFactory.cs) (revision 5f22b93f12f13cf1c558e36f8ea9a4d4300a3744) @@ -30,6 +30,7 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Exceptions; using Ringtoets.Common.Primitives; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; namespace Ringtoets.StabilityPointStructures.Data { @@ -281,14 +282,14 @@ return FailureMechanismAssemblyResultFactory.CreateNotApplicableAssembly(); } - IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; - AssemblyCategoriesInput assemblyCategoriesInput = CreateAssemblyCategoriesInput(failureMechanism, assessmentSection); - IEnumerable sectionAssemblies = failureMechanism.SectionResults - .Select(sr => GetSectionAssembly(sr, failureMechanism, assessmentSection)) - .ToArray(); - try { + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + AssemblyCategoriesInput assemblyCategoriesInput = CreateAssemblyCategoriesInput(failureMechanism, assessmentSection); + IEnumerable sectionAssemblies = failureMechanism.SectionResults + .Select(sr => GetSectionAssembly(sr, failureMechanism, assessmentSection)) + .ToArray(); + IFailureMechanismAssemblyCalculator calculator = calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); @@ -298,6 +299,10 @@ { throw new AssemblyException(e.Message, e); } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } } /// Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r8138b90464358d50c5aa81142b37d309cbdb2c4c -r5f22b93f12f13cf1c558e36f8ea9a4d4300a3744 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs (.../StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 8138b90464358d50c5aa81142b37d309cbdb2c4c) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs (.../StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 5f22b93f12f13cf1c558e36f8ea9a4d4300a3744) @@ -1101,8 +1101,8 @@ // Assert var exception = Assert.Throws(call); Exception innerException = exception.InnerException; - Assert.IsInstanceOf(innerException); - Assert.AreEqual(innerException.Message, exception.Message); + Assert.IsInstanceOf(innerException); + Assert.AreEqual("Voor een of meerdere vakken kan geen resultaat worden bepaald.", exception.Message); mocks.VerifyAll(); } }