diff options
Diffstat (limited to 'Plugins')
-rw-r--r-- | Plugins/Monitors/Common.hs | 4 | ||||
-rw-r--r-- | Plugins/StdinReader.hs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index 1b5cb60..7ac10c2 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -55,7 +55,7 @@ import Data.List import Numeric import Text.ParserCombinators.Parsec import System.Console.GetOpt -import Control.Exception (handle) +import Control.Exception (SomeException,handle) import Plugins -- $monitor @@ -149,7 +149,7 @@ runM args conf action r cb = do go where go = do c <- conf let ac = doArgs args action - s <- handle (const $ return "error") $ runReaderT ac c + s <- handle (\x -> const (return "error") $ x `asTypeOf` (undefined::SomeException)) $ runReaderT ac c cb s tenthSeconds r go diff --git a/Plugins/StdinReader.hs b/Plugins/StdinReader.hs index a12b722..0c075e6 100644 --- a/Plugins/StdinReader.hs +++ b/Plugins/StdinReader.hs @@ -18,7 +18,7 @@ import Prelude hiding (catch) import System.Posix.Process import System.Exit import System.IO -import Control.Exception (catch) +import Control.Exception (SomeException(..),catch) import Plugins data StdinReader = StdinReader @@ -26,7 +26,7 @@ data StdinReader = StdinReader instance Exec StdinReader where start StdinReader cb = do - cb =<< catch (hGetLineSafe stdin) (\e -> do hPrint stderr e; return "") + cb =<< catch (hGetLineSafe stdin) (\(SomeException e) -> do hPrint stderr e; return "") eof <- hIsEOF stdin if eof then exitImmediately ExitSuccess |