Skip to content

Instantly share code, notes, and snippets.

@shtaag
Created August 19, 2012 02:25
Show Gist options
  • Save shtaag/3391080 to your computer and use it in GitHub Desktop.
Save shtaag/3391080 to your computer and use it in GitHub Desktop.
How to Log Exception in errorHandler of Yesod
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