diff --git a/yesod-core/Yesod/Core/Types.hs b/yesod-core/Yesod/Core/Types.hs index eb0f6090..bd76e99e 100644 --- a/yesod-core/Yesod/Core/Types.hs +++ b/yesod-core/Yesod/Core/Types.hs @@ -424,6 +424,13 @@ instance MonadCatch m => MonadCatch (HandlerT site m) where uninterruptibleMask a = HandlerT $ \e -> uninterruptibleMask $ \u -> unHandlerT (a $ q u) e where q u (HandlerT b) = HandlerT (u . b) +instance MonadCatch m => MonadCatch (WidgetT site m) where + catch (WidgetT m) c = WidgetT $ \r -> m r `catch` \e -> unWidgetT (c e) r + mask a = WidgetT $ \e -> mask $ \u -> unWidgetT (a $ q u) e + where q u (WidgetT b) = WidgetT (u . b) + uninterruptibleMask a = + WidgetT $ \e -> uninterruptibleMask $ \u -> unWidgetT (a $ q u) e + where q u (WidgetT b) = WidgetT (u . b) #else monadThrow = lift . monadThrow #endif diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index 08cfb142..bad68e7e 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -1,5 +1,5 @@ name: yesod-core -version: 1.2.12 +version: 1.2.13 license: MIT license-file: LICENSE author: Michael Snoyman