Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ConvergenceParser.cs =================================================================== diff -u -r4bf03fe0c441a3f3d439bc7ffe09350227435178 -rc235d644419c9f398fd806f7dce2592f0974ac97 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ConvergenceParser.cs (.../ConvergenceParser.cs) (revision 4bf03fe0c441a3f3d439bc7ffe09350227435178) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ConvergenceParser.cs (.../ConvergenceParser.cs) (revision c235d644419c9f398fd806f7dce2592f0974ac97) @@ -20,8 +20,6 @@ // All rights reserved. using System; -using System.Data.SQLite; -using Ringtoets.HydraRing.Calculation.Exceptions; using Ringtoets.HydraRing.Calculation.Properties; using Ringtoets.HydraRing.Calculation.Readers; @@ -53,38 +51,14 @@ throw new ArgumentNullException(nameof(workingDirectory)); } - ParseFile(workingDirectory, sectionId); + HydraRingDatabaseParseHelper.Parse(workingDirectory, + getLastResultQuery, + sectionId, + Resources.ParseFile_No_convergence_found_in_output_file, + ReadResult); } /// - /// Parses the file. - /// - /// The path to the directory which contains - /// the output of the Hydra-Ring calculation. - /// The section id to get the output for. - /// Thrown when the reader - /// encounters an error while reading the database. - private void ParseFile(string workingDirectory, int sectionId) - { - try - { - using (var reader = new HydraRingDatabaseReader(workingDirectory, getLastResultQuery, sectionId)) - { - reader.Execute(); - ReadResult(reader); - } - } - catch (SQLiteException e) - { - throw new HydraRingFileParserException(Resources.ParseFile_Cannot_read_result_in_output_file, e); - } - catch (Exception e) when (e is HydraRingDatabaseReaderException || e is InvalidCastException) - { - throw new HydraRingFileParserException(Resources.ParseFile_No_convergence_found_in_output_file, e); - } - } - - /// /// Reads the result of the . /// /// The reader to get the result from.