Index: Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocationReader.cs
===================================================================
diff -u -rd2b9feaf8aceaa9a96d0e6e19fd6fbbee8987ca6 -rbd0179e92bcc6367c2760df65b80b08e52acbb86
--- Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocationReader.cs (.../ProfileLocationReader.cs) (revision d2b9feaf8aceaa9a96d0e6e19fd6fbbee8987ca6)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocationReader.cs (.../ProfileLocationReader.cs) (revision bd0179e92bcc6367c2760df65b80b08e52acbb86)
@@ -120,7 +120,13 @@
///
/// Shape file path.
/// Thrown when is invalid.
- /// Shapefile does not only contain point features.
+ /// Thrown when
+ ///
+ /// - points to a file that doesn't exist.
+ /// - The shapefile has non-point geometries in it.
+ /// - An unexpected error occurred when reading the shapefile.
+ ///
+ ///
/// Return an instance of .
private static PointShapeFileReader OpenPointsShapeFile(string shapeFilePath)
{
@@ -130,9 +136,14 @@
}
catch (CriticalFileReadException e)
{
- string message = new FileReaderErrorMessageBuilder(shapeFilePath)
- .Build(Resources.ProfileLocationReader_OpenPointsShapeFile_File_can_only_contain_points);
- throw new CriticalFileReadException(message, e);
+ if (e.InnerException.GetType() == typeof(ApplicationException))
+ {
+ string message = new FileReaderErrorMessageBuilder(shapeFilePath)
+ .Build(Resources.ProfileLocationReader_OpenPointsShapeFile_File_can_only_contain_points);
+ throw new CriticalFileReadException(message, e);
+ }
+
+ throw;
}
}