Add Failure instance for GHandler

This commit is contained in:
Michael Snoyman 2013-01-27 19:03:53 +02:00
parent 9829e949c2
commit 3786362300

View File

@ -129,6 +129,7 @@ import Control.Exception hiding (Handler, catch, finally)
import Control.Applicative
import Control.Monad (liftM)
import Control.Failure (Failure (failure))
import Control.Monad.IO.Class
import Control.Monad.Trans.Class (MonadTrans)
@ -1059,3 +1060,6 @@ instance MonadLogger (GHandler sub master) where
monadLoggerLogSource a b c d = do
hd <- ask
liftIO $ handlerLog hd a b c (toLogStr d)
instance Exception e => Failure e (GHandler sub master) where
failure = liftIO . throwIO