From bfc06f1ff188c9d7faa817034363a27e34eae15a Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 8 Feb 2010 00:11:46 +0100 Subject: Fixed the clean killing of plugin's threads, fixed exception management and cleaned plugins' main functions. --- Hsbot/Main.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Hsbot/Main.hs') diff --git a/Hsbot/Main.hs b/Hsbot/Main.hs index ea1bf16..592fefa 100644 --- a/Hsbot/Main.hs +++ b/Hsbot/Main.hs @@ -2,7 +2,9 @@ module Hsbot.Main ( imain ) where +import Control.Exception import Control.Monad.State +import Prelude hiding (catch) import System.IO import Config @@ -15,8 +17,8 @@ import Hsbot.Types imain :: IO () imain = do bot <- connectServer $ ircServer config - bot' <- (execStateT run bot) `catch` (const $ return bot) - evalStateT disconnectServer bot' + (execStateT run bot) `catch` (\(ex :: IOException) -> return bot) + evalStateT disconnectServer bot -- | The Bot monad main function run :: IrcBot () -- cgit v1.2.3