Cleanup
This commit is contained in:
parent
d1e4fd485b
commit
46af7bfb76
@ -257,7 +257,7 @@ class RenderRoute site => Yesod site where
|
||||
--
|
||||
-- @since 1.6.16
|
||||
jsAttributesHandler :: HandlerFor site [(Text, Text)]
|
||||
jsAttributesHandler = getYesod >>= return . jsAttributes
|
||||
jsAttributesHandler = jsAttributes <$> getYesod
|
||||
|
||||
-- | Create a session backend. Returning 'Nothing' disables
|
||||
-- sessions. If you'd like to change the way that the session
|
||||
@ -639,7 +639,7 @@ defaultErrorHandler NotFound = selectRep $ do
|
||||
let path' = TE.decodeUtf8With TEE.lenientDecode $ W.rawPathInfo r
|
||||
defaultMessageWidget "Not Found" [hamlet|<p>#{path'}|]
|
||||
provideRep $ return $ object ["message" .= ("Not Found" :: Text)]
|
||||
provideRep $ return $ ("Not Found" :: Text)
|
||||
provideRep $ return ("Not Found" :: Text)
|
||||
|
||||
-- For API requests.
|
||||
-- For a user with a browser,
|
||||
@ -663,7 +663,7 @@ defaultErrorHandler NotAuthenticated = selectRep $ do
|
||||
let apair u = ["authentication_url" .= rend u]
|
||||
content = maybe [] apair (authRoute site)
|
||||
return $ object $ ("message" .= ("Not logged in"::Text)):content
|
||||
provideRep $ return $ ("Not logged in" :: Text)
|
||||
provideRep $ return ("Not logged in" :: Text)
|
||||
|
||||
defaultErrorHandler (PermissionDenied msg) = selectRep $ do
|
||||
provideRep $ defaultLayout $ defaultMessageWidget
|
||||
@ -682,7 +682,7 @@ defaultErrorHandler (InvalidArgs ia) = selectRep $ do
|
||||
<li>#{msg}
|
||||
|]
|
||||
provideRep $ return $ object ["message" .= ("Invalid Arguments" :: Text), "errors" .= ia]
|
||||
provideRep $ return $ ("Invalid Arguments: " <> T.intercalate " " ia)
|
||||
provideRep $ return ("Invalid Arguments: " <> T.intercalate " " ia)
|
||||
|
||||
defaultErrorHandler (InternalError e) = do
|
||||
$logErrorS "yesod-core" e
|
||||
|
||||
Loading…
Reference in New Issue
Block a user