Add MonadCatch for WidgetT

This commit is contained in:
Michael Snoyman 2014-04-14 08:32:55 +03:00
parent 186a676a5c
commit e036f934f6
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -1,5 +1,5 @@
name: yesod-core
version: 1.2.12
version: 1.2.13
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>