Created
August 19, 2012 02:25
-
-
Save shtaag/3391080 to your computer and use it in GitHub Desktop.
How to Log Exception in errorHandler of Yesod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance Yesod App where | |
errorHandler (InternalError e) = do | |
$(logWarn) e | |
applyLayout "My Internal Server Error." [hamlet| <h1> my internal server error|] | |
where applyLayout :: Yesod master => Html -> HtmlUrl (Route master) -> GHandler sub master ChooseRep | |
applyLayout title body = fmap chooseRep $ defaultLayout $ do | |
setTitle title | |
toWidget body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment