Improve error handling

- catch errors while loading themes
- use user's actual home directory to look for config files
- restructure main function
This commit is contained in:
Joscha 2018-03-22 09:51:52 +00:00
parent ea83f1aabf
commit bbe6cd830f
3 changed files with 90 additions and 34 deletions

View file

@ -25,8 +25,9 @@ defaultConfig = Config
, cTaskDB = "~/.taskmachine/tasks.db"
}
defaultConfigFilePaths :: [FilePath]
defaultConfigFilePaths = ["tasks.conf", "~/.taskmachine/tasks.conf"]
defaultConfigFilePaths :: FilePath -> [FilePath]
defaultConfigFilePaths homedir =
[homedir ++ "/.taskmachine/tasks.conf", "tasks.conf"]
newtype CPException = CPException C.CPErrorData
deriving (Show)