diff options
| author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-24 11:25:51 +0200 | 
|---|---|---|
| committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-24 11:25:51 +0200 | 
| commit | 2b6df4ff82e2dfb88f1dc781c31ed6d5b83c5d38 (patch) | |
| tree | 364a92567b6cc322755e94169f03db44e5e302f2 | |
| parent | bfa9857911ad30ffdc1d22f9433eb85143c0d528 (diff) | |
| download | xmobar-2b6df4ff82e2dfb88f1dc781c31ed6d5b83c5d38.tar.gz xmobar-2b6df4ff82e2dfb88f1dc781c31ed6d5b83c5d38.tar.bz2 | |
Main.hs: removed exception
Check for default configuration file existence instead.
darcs-hash:20070724092551-d6583-5067ca0bf7b95ef3afe846b008cca1077fecc569.gz
| -rw-r--r-- | Main.hs | 8 | 
1 files changed, 4 insertions, 4 deletions
| @@ -27,7 +27,7 @@ import Data.IORef  import System.Console.GetOpt  import System.Exit  import System.Environment -import System.IO.Error +import System.Posix.Files  -- $main @@ -57,13 +57,13 @@ readConfig f =           [] -> error ("Corrupt config file: " ++ f)           _ -> error ("Some problem occured. Aborting...") --- | Read default configuration or quit with an error +-- | Read default configuration file or load the default config  readDefaultConfig :: IO Config  readDefaultConfig =       do home <- getEnv "HOME"         let path = home ++ "/.xmobarrc" -       catch (readConfig path) -            (\e -> if isUserError e then ioError e else return defaultConfig) +       f <- fileExist path +       if f then readConfig path else return defaultConfig  data Opts = Help            | Version  | 
