ContentsIndex
Framework.Exceptions
Contents
Functions that are specific to application-level controllers
Synopsis
raiseC :: Int -> String -> AController a
raiseIO :: StaticConfig -> HttpRequest -> Int -> String -> IO HttpResponse
internalError :: String -> AController a
errorIf :: Int -> String -> Bool -> Controller s HttpResponse ()
methodOnly :: RequestMethod -> AController a -> AController a
ifMethod :: RequestMethod -> a -> AController a -> AController a
forceMaybe :: String -> Maybe a -> AController a
Documentation
raiseC
::
=> IntHTTP error code
-> StringMessage
-> AController a
Raise an exception in controller
raiseIO
:: StaticConfigStatic (global) config
-> HttpRequest
-> IntHTTP error code
-> StringMessage
-> IO HttpResponse
Raise an exception in IO monad
Functions that are specific to application-level controllers
internalError :: String -> AController a
Return HTTP 500 error with given message
errorIf
::
=> IntHTTP status code
-> StringError message
-> BoolValue of condition
-> Controller s HttpResponse ()
Return HTTP error with given code, if condition is satisfied
methodOnly :: RequestMethod -> AController a -> AController a
Run controller only if request method is as given, else raise HTTP 400 error
ifMethod
::
=> RequestMethod
-> aDefault value
-> AController aRun this
-> AController a
Run a controller only if given HTTP method, otherwise return default value
forceMaybe
::
=> StringError message
-> Maybe aMaybe value
-> AController a
If value is supplied, return it. Otherwise, raise HTTP 500 error.
Produced by Haddock version 2.4.2