Index: Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/CalculationConfigurationImporter.cs =================================================================== diff -u -r3f8a98df037e5ab1623b4d786a37bf3797b85f78 -rcc8b9d8e93577a236afec4dd16a25f89996241fa --- Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/CalculationConfigurationImporter.cs (.../CalculationConfigurationImporter.cs) (revision 3f8a98df037e5ab1623b4d786a37bf3797b85f78) +++ Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/CalculationConfigurationImporter.cs (.../CalculationConfigurationImporter.cs) (revision cc8b9d8e93577a236afec4dd16a25f89996241fa) @@ -117,6 +117,24 @@ /// Thrown when something goes wrong while parsing. protected abstract ICalculation ParseReadCalculation(TReadCalculation readCalculation); + /// + /// Performs the provided and handles any thrown . + /// + /// The action to perform. + /// The error message to provide when rethrowing any thrown . + /// Thrown when throws an . + protected static void PerformActionHandlingAnyArgumentOutOfRangeException(Action action, string errorMessage) + { + try + { + action(); + } + catch (ArgumentOutOfRangeException e) + { + throw new CriticalFileValidationException($"{errorMessage} {e.Message}"); + } + } + private ReadResult ReadConfiguration() { try