Skip to content

Commit

Permalink
Issue #221 throw an exception if coefficients path not a valid file
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterVermont committed Mar 11, 2019
1 parent e448552 commit a3cf241
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions DaySim.Framework/ChoiceModels/ChoiceProbabilityFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.


using System;
using System.IO;
using DaySim.Framework.Coefficients;

Expand Down Expand Up @@ -33,13 +34,12 @@ public sealed class ChoiceProbabilityFactory {

if (file.Exists) {
coefficientsReader = new CoefficientsReader();

} else {
string message = string.Format("No file exists at coefficientsPath '{0}'", coefficientsPath);
DaySim.Framework.Core.Global.PrintFile.WriteLine(message, true);
throw new Exception(message);
}
}
if (coefficientsReader == null) {

}

if (coefficientsReader != null) {

_coefficients = coefficientsReader.Read(coefficientsPath, out _title, out _sizeFunctionMultiplier,
Expand Down Expand Up @@ -70,4 +70,4 @@ public sealed class ChoiceProbabilityFactory {
return choiceProbabilityCalculator;
}
}
}
}

0 comments on commit a3cf241

Please sign in to comment.