This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-server".

The branch, 0.3 has been updated
       via  2ce59a1cc88d948d941e2b78b287c10a3ea3d011 (commit)
      from  ca9653aa7f3b0f60232c1a776e2f581c1d9fd68b (commit)


Summary of changes:
 src/Snap/Http/Server/Config.hs |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2ce59a1cc88d948d941e2b78b287c10a3ea3d011
Author: Carl Howells <[email protected]>
Date:   Sun Jul 18 12:10:04 2010 -0700

    Calculate error response length properly

diff --git a/src/Snap/Http/Server/Config.hs b/src/Snap/Http/Server/Config.hs
index 1dd78be..a0f0beb 100644
--- a/src/Snap/Http/Server/Config.hs
+++ b/src/Snap/Http/Server/Config.hs
@@ -45,7 +45,6 @@ import qualified Data.ByteString.Char8 as B
 import           Data.ByteString (ByteString)
 import           Data.Char
 import           Data.List
-import           Data.Maybe
 import           Data.Monoid
 import           Prelude hiding (catch)
 import           Snap.Types
@@ -168,13 +167,14 @@ defaultConfig = Config
     , locale       = Just "en_US"
     , compression  = Just True
     , verbose      = Just True
-    , errorHandler = Just $ \e -> let msg = U.fromString $ show e in
+    , errorHandler = Just $ \e -> do
+        let err = U.fromString $ show e
+            msg = mappend "A web handler threw an exception. Details:\n" err
         finishWith $ setContentType "text/plain; charset=utf-8"
-        . setContentLength (fromIntegral $ B.length msg)
-        . setResponseStatus 500 "Internal Server Error"
-        . modifyResponseBody (>. (enumBS $ mappend
-            "A web handler threw an exception. Details:\n" msg))
-        $ emptyResponse
+                   . setContentLength (fromIntegral $ B.length msg)
+                   . setResponseStatus 500 "Internal Server Error"
+                   . modifyResponseBody (>. enumBS msg)
+                   $ emptyResponse
     , other        = Nothing
     }
 
-----------------------------------------------------------------------


hooks/post-receive
-- 
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to