From edc6bdd581e7208e9de055401aaf02390312ff6f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 25 Mar 2014 05:29:45 +0200 Subject: [PATCH 1/2] Use defaultShouldDisplayException --- yesod/Yesod/Default/Main.hs | 10 +++++++++- yesod/yesod.cabal | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/yesod/Yesod/Default/Main.hs b/yesod/Yesod/Default/Main.hs index 0780539a..e273de2b 100644 --- a/yesod/Yesod/Default/Main.hs +++ b/yesod/Yesod/Default/Main.hs @@ -14,6 +14,7 @@ import Yesod.Default.Config import Network.Wai (Application) import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsPort, settingsHost, settingsOnException) +import qualified Network.Wai.Handler.Warp as Warp import System.Directory (doesDirectoryExist, removeDirectoryRecursive) import Network.Wai.Middleware.Gzip (gzip, GzipFiles (GzipCacheFolder), gzipFiles, def) import Network.Wai.Middleware.Autohead (autohead) @@ -68,12 +69,19 @@ defaultMainLog load getApp = do runSettings defaultSettings { settingsPort = appPort config , settingsHost = appHost config - , settingsOnException = const $ \e -> logFunc + , settingsOnException = const $ \e -> when (shouldLog' e) $ logFunc $(qLocation >>= liftLoc) "yesod" LevelError (toLogStr $ "Exception from Warp: " ++ show e) } app + where + shouldLog' = +#if MIN_VERSION_wai(2,1,3) + Warp.defaultShouldDisplayException +#else + const True +#endif -- | Run your application continously, listening for SIGINT and exiting -- when received diff --git a/yesod/yesod.cabal b/yesod/yesod.cabal index 1d3f5ee8..1f9e1b7e 100644 --- a/yesod/yesod.cabal +++ b/yesod/yesod.cabal @@ -1,5 +1,5 @@ name: yesod -version: 1.2.5 +version: 1.2.5.1 license: MIT license-file: LICENSE author: Michael Snoyman From 2fd70b6e443aa3521d0022f1beaff7755aaed681 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 25 Mar 2014 05:40:03 +0200 Subject: [PATCH 2/2] Bump yesod-auth upper bound in yesod --- yesod/yesod.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod/yesod.cabal b/yesod/yesod.cabal index 1f9e1b7e..2e65c25b 100644 --- a/yesod/yesod.cabal +++ b/yesod/yesod.cabal @@ -23,7 +23,7 @@ library build-depends: base >= 4.3 && < 5 , yesod-core >= 1.2.2 && < 1.3 - , yesod-auth >= 1.2 && < 1.3 + , yesod-auth >= 1.2 && < 1.4 , yesod-persistent >= 1.2 && < 1.3 , yesod-form >= 1.3 && < 1.4 , monad-control >= 0.3 && < 0.4