summaryrefslogtreecommitdiffhomepage
path: root/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/Main.hs b/Main.hs
index c8ce30d..44dda60 100644
--- a/Main.hs
+++ b/Main.hs
@@ -64,11 +64,8 @@ readConfig :: FilePath -> IO Config
readConfig f = do
file <- fileExist f
s <- if file then readFileSafe f else error $ f ++ ": file not found!\n" ++ usage
- case reads s of
- [(conf,_)] -> return conf
- [] -> error $ f ++ ": configuration file contains errors!\n" ++ usage
- _ -> error ("Some problem occured. Aborting...")
-
+ either (\err -> error $ f ++ ": configuration file contains errors at:\n" ++ show err)
+ return $ parseConfig s
-- | Read default configuration file or load the default config
readDefaultConfig :: IO Config
readDefaultConfig = do