Index: Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/DikeProfilesImporter.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -rd12c953518f14c3d50136775b2c03afdf3a4f8f1 --- Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/DikeProfilesImporter.cs (.../DikeProfilesImporter.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/DikeProfilesImporter.cs (.../DikeProfilesImporter.cs) (revision d12c953518f14c3d50136775b2c03afdf3a4f8f1) @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.Linq; using Core.Common.Base; +using Core.Common.Base.IO; using Core.Common.IO.Readers; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; @@ -103,8 +104,8 @@ } } - private IEnumerable CreateDikeProfiles(IEnumerable dikeProfileLocationCollection, - ICollection dikeProfileDataCollection) + private static IEnumerable CreateDikeProfiles(IEnumerable dikeProfileLocationCollection, + ICollection dikeProfileDataCollection) { var dikeProfiles = new List(); foreach (ProfileLocation dikeProfileLocation in dikeProfileLocationCollection) @@ -114,13 +115,11 @@ DikeProfileData dikeProfileData = GetMatchingDikeProfileData(dikeProfileDataCollection, id); if (dikeProfileData == null) { - Log.ErrorFormat(Resources.DikeProfilesImporter_GetMatchingDikeProfileData_no_dikeprofiledata_for_location_0_, id); + string message = string.Format(Resources.DikeProfilesImporter_GetMatchingDikeProfileData_no_dikeprofiledata_for_location_0_, id); + throw new CriticalFileReadException(message); } - else - { - DikeProfile dikeProfile = CreateDikeProfile(dikeProfileLocation, dikeProfileData); - dikeProfiles.Add(dikeProfile); - } + DikeProfile dikeProfile = CreateDikeProfile(dikeProfileLocation, dikeProfileData); + dikeProfiles.Add(dikeProfile); } return dikeProfiles; }