correct the wrapper
This commit is contained in:
parent
acd2bb61e4
commit
8a8bfa7ec7
@ -72,7 +72,7 @@ webSockets inner = do
|
|||||||
src
|
src
|
||||||
sink
|
sink
|
||||||
|
|
||||||
|
-- | Wrapper for capturing exceptions
|
||||||
wrapWSE :: (MonadIO m, WS.WebSocketsData a) => (WS.Connection -> a -> IO ())-> a -> WebSocketsT m (Either SomeException ())
|
wrapWSE :: (MonadIO m, WS.WebSocketsData a) => (WS.Connection -> a -> IO ())-> a -> WebSocketsT m (Either SomeException ())
|
||||||
wrapWSE ws x = ReaderT $ liftIO . tryAny . flip ws x
|
wrapWSE ws x = ReaderT $ liftIO . tryAny . flip ws x
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ sendTextData = wrapWS WS.sendTextData
|
|||||||
-- `either handle_exception return =<< sendTextDataE ("Welcome" :: Text)`
|
-- `either handle_exception return =<< sendTextDataE ("Welcome" :: Text)`
|
||||||
-- Since 0.1.1.3
|
-- Since 0.1.1.3
|
||||||
sendTextDataE :: (MonadIO m, WS.WebSocketsData a) => a -> WebSocketsT m (Either SomeException ())
|
sendTextDataE :: (MonadIO m, WS.WebSocketsData a) => a -> WebSocketsT m (Either SomeException ())
|
||||||
sendTextDataE = wrapWS WS.sendTextData
|
sendTextDataE = wrapWSE WS.sendTextData
|
||||||
|
|
||||||
-- | Send a binary message to the client.
|
-- | Send a binary message to the client.
|
||||||
--
|
--
|
||||||
@ -112,7 +112,7 @@ sendBinaryData :: (MonadIO m, WS.WebSocketsData a) => a -> WebSocketsT m ()
|
|||||||
sendBinaryData = wrapWS WS.sendBinaryData
|
sendBinaryData = wrapWS WS.sendBinaryData
|
||||||
|
|
||||||
-- | Send a binary message to the client.
|
-- | Send a binary message to the client.
|
||||||
-- Capture SomeException as the result or operation
|
-- Capture SomeException as the result of operation
|
||||||
-- Since 0.1.1.3
|
-- Since 0.1.1.3
|
||||||
sendBinaryDataE :: (MonadIO m, WS.WebSocketsData a) => a -> WebSocketsT m (Either SomeException ())
|
sendBinaryDataE :: (MonadIO m, WS.WebSocketsData a) => a -> WebSocketsT m (Either SomeException ())
|
||||||
sendBinaryDataE = wrapWSE WS.sendBinaryData
|
sendBinaryDataE = wrapWSE WS.sendBinaryData
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user