config add exception when config file is not found

This commit is contained in:
Hylke Bons 2011-05-25 01:15:30 +01:00
parent 7634b7f655
commit 607b347dd5

View file

@ -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) { }
}
}