| Copyright | (C) 2017-2018 Johann Lee <me@qinka.pro> |
|---|---|
| License | GPL3 |
| Maintainer | me@qinka.pro |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Yu.Utils.Handler
Description
The method which might be useful for server
- catchH :: Exception e => HandlerT site IO a -> (e -> HandlerT site IO a) -> HandlerT site IO a
- handlerH :: Exception e => (e -> HandlerT site IO a) -> HandlerT site IO a -> HandlerT site IO a
- tryH :: Exception e => HandlerT site IO a -> HandlerT site IO (Either e a)
- (<#>) :: (Functor f1, Functor f2) => (a -> b) -> f1 (f2 a) -> f1 (f2 b)
- (<%>) :: (Monad m, Functor f) => (a -> m b) -> f (m a) -> f (m b)
- returnE :: (Monad m, Exception e) => e -> m String
- returnET :: (Monad m, Exception e) => e -> m Text
- returnEH :: SomeException -> HandlerT site IO TypedContent
- showJs :: Show a => a -> RawJavascript
- fromBinToBytestr :: Binary -> ByteString
- data LogPath
about exception
Arguments
| :: Exception e | |
| => HandlerT site IO a | the action |
| -> (e -> HandlerT site IO a) | the exception handler |
| -> HandlerT site IO a | return |
The method to catch the exception (in HadnlerT)
Arguments
| :: Exception e | |
| => (e -> HandlerT site IO a) | the handler for exceptions |
| -> HandlerT site IO a | operation |
| -> HandlerT site IO a |
The method for handler, equal to flip catchH
Arguments
| :: Exception e | |
| => HandlerT site IO a | action |
| -> HandlerT site IO (Either e a) | return the result or the exception |
The method for a try
about functor and moand
the operator just like $
return the exception
a method to return a `exception' when it catched
the text-returned version for returnE
Arguments
| :: SomeException | exception |
| -> HandlerT site IO TypedContent |
the HandlerT version for returnE and returnEt
others
showJs :: Show a => a -> RawJavascript Source #
show the js
fromBinToBytestr :: Binary -> ByteString Source #
from binary to bytestring
the path for logger
Orphan instances
| ToJSON ErrorResponse Source # | instance the error response to json |