Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilProfile1DReader.cs
===================================================================
diff -u -rc1e31ab57c197658d1c75750feef8856df7e9f6b -rd082f5444ccd9571f4fabb4c47f1082fa5ece21e
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilProfile1DReader.cs (.../SoilProfile1DReader.cs) (revision c1e31ab57c197658d1c75750feef8856df7e9f6b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilProfile1DReader.cs (.../SoilProfile1DReader.cs) (revision d082f5444ccd9571f4fabb4c47f1082fa5ece21e)
@@ -36,22 +36,25 @@
reader.MoveNext();
}
- return Build(soilProfileBuilder, profileName);
+ return Build(soilProfileBuilder, reader.Path, profileName);
}
///
/// Builds a from the given .
///
/// Thrown when building the failed.
- private static PipingSoilProfile Build(SoilProfileBuilder1D soilProfileBuilder, string profileName)
+ private static PipingSoilProfile Build(SoilProfileBuilder1D soilProfileBuilder, string path, string profileName)
{
try
{
return soilProfileBuilder.Build();
}
catch (SoilProfileBuilderException e)
{
- throw new PipingSoilProfileReadException(profileName, e.Message, e);
+ var message = new FileReaderErrorMessageBuilder(path)
+ .WithSubject(string.Format(Resources.PipingSoilProfileReader_SoilProfileName_0_, profileName))
+ .Build(e.Message);
+ throw new PipingSoilProfileReadException(profileName, message, e);
}
}
@@ -95,7 +98,9 @@
}
catch (InvalidCastException e)
{
- var message = string.Format(Resources.PipingSoilProfileReader_Profile_0_has_invalid_value_on_Column_1_, profileName, readColumn);
+ var message = new FileReaderErrorMessageBuilder(reader.Path)
+ .WithSubject(string.Format(Resources.PipingSoilProfileReader_SoilProfileName_0_, profileName))
+ .Build(string.Format(Resources.PipingSoilProfileReader_Profile_has_invalid_value_on_Column_0_, readColumn));
throw new PipingSoilProfileReadException(profileName, message, e);
}
}
@@ -139,7 +144,9 @@
}
catch (InvalidCastException e)
{
- var message = string.Format(Resources.PipingSoilProfileReader_Profile_0_has_invalid_value_on_Column_1_, profileName, readColumn);
+ var message = new FileReaderErrorMessageBuilder(reader.Path)
+ .WithSubject(String.Format(Resources.PipingSoilProfileReader_SoilProfileName_0_, profileName))
+ .Build(string.Format(Resources.PipingSoilProfileReader_Profile_has_invalid_value_on_Column_0_, readColumn));
throw new PipingSoilProfileReadException(profileName, message, e);
}
}