Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs =================================================================== diff -u -refdfbe3c54d3743aa50b0fc7be73e417638f2732 -r14bc51c4c374a77f6e5b7e4f707eb0f412bb668a --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs (.../PipingConfigurationReader.cs) (revision efdfbe3c54d3743aa50b0fc7be73e417638f2732) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs (.../PipingConfigurationReader.cs) (revision 14bc51c4c374a77f6e5b7e4f707eb0f412bb668a) @@ -60,7 +60,7 @@ XDocument xmlDocument = LoadDocument(xmlFilePath); - ValidateToSchema(xmlDocument); + ValidateToSchema(xmlDocument, xmlFilePath); } /// @@ -112,18 +112,20 @@ /// Validates the provided XML document based on a predefined XML Schema Definition (XSD). /// /// The XML document to validate. + /// The file path the XML document is loaded from. /// Thrown when the provided XML document does not match the predefined XML Schema Definition (XSD). - private static void ValidateToSchema(XDocument document) + private static void ValidateToSchema(XDocument document, string xmlFilePath) { XmlSchemaSet schema = LoadXmlSchema(); try { document.Validate(schema, null); } - catch (XmlSchemaValidationException e) + catch (XmlSchemaValidationException exception) { - throw new CriticalFileReadException(Resources.PipingConfigurationReader_Configuration_contains_no_valid_xml, e); + string message = new FileReaderErrorMessageBuilder(xmlFilePath).Build(Resources.PipingConfigurationReader_Configuration_contains_no_valid_xml); + throw new CriticalFileReadException(message, exception); } }