mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
TD-115: Throw error when config file is missing or not readable
TD-49: Log when file management fails - Thanks to Jelle van der Waa, Ben Boeckel.
This commit is contained in:
parent
152f9b0884
commit
64f87e3c38
3 changed files with 14 additions and 1 deletions
2
AUTHORS
2
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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue