diff --git a/AUTHORS b/AUTHORS index 4b80999f..a50896d6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,6 +10,7 @@ The following submitted code, packages or analysis, and deserve special thanks: Tomas Babej Dirk Deimeke Wim Schuermann + Jelle van der Waa Thanks to the following, who submitted detailed bug reports and excellent suggestions: @@ -18,3 +19,4 @@ suggestions: creatid Frédéric Meynadier Bruno Vernay + Ben Boeckel diff --git a/ChangeLog b/ChangeLog index 167cc7a0..794f4520 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ 0.1.0 () - +- TD-49 Log when file management fails + (thanks to Ben Boeckel). +- TD-115 Throw error when config file is missing or not readable + (thanks to Jelle van der Waa). - Added 'continue' command. - Added 'diagnostics' command. - Added 'export' command. diff --git a/src/Rules.cpp b/src/Rules.cpp index ecfdfaad..d3a3d918 100644 --- a/src/Rules.cpp +++ b/src/Rules.cpp @@ -50,7 +50,14 @@ void Rules::load (const std::string& file, int nest /* = 1 */) if (nest == 1) { _settings = defaultSettings; - _original_file = File (file)._data; + File originalFile (file); + _original_file = originalFile._data; + + if (! originalFile.exists ()) + throw std::string ("ERROR: Configuration file not found."); + + if (! originalFile.readable ()) + throw std::string ("ERROR: Configuration file cannot be read (insufficient privileges)."); } // Read the file, then parse the contents.