diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2011-04-02 19:00:09 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2011-04-02 19:00:09 -0400 |
commit | 3a38c21f5b68abb8faab46fb37e126ffa70e2989 (patch) | |
tree | 014263ab14137759c703a83f53a151783136ff06 /src/Plugins/Monitors/Batt.hs | |
parent | a6043e7831d941a03d098552bda9b824247c4715 (diff) | |
download | xmobar-3a38c21f5b68abb8faab46fb37e126ffa70e2989.tar.gz xmobar-3a38c21f5b68abb8faab46fb37e126ffa70e2989.tar.bz2 |
Use 0 if reading the file fails
Diffstat (limited to 'src/Plugins/Monitors/Batt.hs')
-rw-r--r-- | src/Plugins/Monitors/Batt.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs index a472045..c276e6b 100644 --- a/src/Plugins/Monitors/Batt.hs +++ b/src/Plugins/Monitors/Batt.hs @@ -124,7 +124,7 @@ readBattery files = (3600 * b / 1000000) -- wattseconds (c / 1000000) -- volts (if c > 0 then (d / c) else -1) -- amperes - where grab = fmap (read . B.unpack) . B.readFile + where grab f = catch (fmap (read . B.unpack) $ B.readFile f) (\_ -> return 0) readBatteries :: BattOpts -> [Files] -> IO Result readBatteries opts bfs = |