Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ConvergenceParser.cs
===================================================================
diff -u -rae74507edbfc4fe632ba5f964a147aff630dfe6e -rda9e421535781dd8f6bfdf84cee460d757cbcfb5
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ConvergenceParser.cs (.../ConvergenceParser.cs) (revision ae74507edbfc4fe632ba5f964a147aff630dfe6e)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ConvergenceParser.cs (.../ConvergenceParser.cs) (revision da9e421535781dd8f6bfdf84cee460d757cbcfb5)
@@ -25,6 +25,7 @@
using System.IO;
using Core.Common.Utils;
using Ringtoets.HydraRing.Calculation.Exceptions;
+using Ringtoets.HydraRing.Calculation.Properties;
using Ringtoets.HydraRing.IO;
namespace Ringtoets.HydraRing.Calculation.Parsers
@@ -81,16 +82,29 @@
return new SQLiteConnection(connectionStringBuilder);
}
+ ///
+ /// Reads the value indicating whether the calculation for a section has converged.
+ ///
+ /// The connection to the database.
+ /// The section id to get the output for.
+ /// Thrown when:
+ ///
+ /// - the output file does not exist.
+ /// - the convergence result could not be read from the output file.
+ ///
+ ///
private void ReadIsConverged(SQLiteConnection sqLiteConnection, int sectionId)
{
try
{
- SQLiteDataReader reader = CreateReader(sqLiteConnection, sectionId);
+ using (SQLiteDataReader reader = CreateReader(sqLiteConnection, sectionId))
+ {
SetOutput(reader);
}
+ }
catch (SQLiteException e)
{
- throw new HydraRingFileParserException("Er kon geen resultaat voor convergentie gelezen worden uit de Hydra-Ring uitvoerdatabase.", e);
+ throw new HydraRingFileParserException(Resources.Parse_Cannot_read_convergence_in_output_file, e);
}
}
@@ -115,6 +129,11 @@
return command;
}
+ ///
+ /// Opens the connection using .
+ ///
+ /// The connection to open.
+ /// Thrown when could not be opened.
private static void OpenConnection(SQLiteConnection connection)
{
try
@@ -127,6 +146,11 @@
}
}
+ ///
+ /// Sets with the value read in the .
+ ///
+ /// The reader to use.
+ /// Thrown when no result could be read using the .
private void SetOutput(SQLiteDataReader reader)
{
if (reader.Read())
@@ -135,7 +159,7 @@
}
else
{
- throw new HydraRingFileParserException("Er is geen resultaat voor convergentie gevonden in de Hydra-Ring uitvoerdatabase.");
+ throw new HydraRingFileParserException(Resources.Parse_No_convergence_found_in_output_file);
}
}
}