diff --git a/SparkleLib/SparkleConfig.cs b/SparkleLib/SparkleConfig.cs index fb9e504b..c8f9e407 100644 --- a/SparkleLib/SparkleConfig.cs +++ b/SparkleLib/SparkleConfig.cs @@ -16,6 +16,7 @@ using System; +using System.IO; using System.Xml; namespace SparkleLib { @@ -30,6 +31,9 @@ namespace SparkleLib { public SparkleConfig (string path) { + if (!File.Exists (path)) + throw new ConfigFileNotFoundException (path + " does not exist"); + Path = path; Load (Path); } @@ -95,4 +99,11 @@ namespace SparkleLib { Save (Path); } } -} + + + public class ConfigFileNotFoundException : Exception { + + public ConfigFileNotFoundException (string message) + : base (message) { } + } +} \ No newline at end of file