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".

The branch, master has been updated
       via  6ae7a701339d576331630face024af5e8e019265 (commit)
      from  af809185dea151755f047d320cd141f92cba87ca (commit)


Summary of changes:
 src/Snap/Error.hs       |   45 ---------------------------------------------
 src/Snap/Loader/Hint.hs |    3 +--
 2 files changed, 1 insertions(+), 47 deletions(-)
 delete mode 100644 src/Snap/Error.hs

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 6ae7a701339d576331630face024af5e8e019265
Author: Shane <[email protected]>
Date:   Tue Jul 13 18:26:56 2010 +0100

    Removed error handling stuff as it duplicates functionality in snap-server.

diff --git a/src/Snap/Error.hs b/src/Snap/Error.hs
deleted file mode 100644
index 3bfb2f1..0000000
--- a/src/Snap/Error.hs
+++ /dev/null
@@ -1,45 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
--- | This module contains a couple simple functions for helping Snap
--- applications deal with errors.
-module Snap.Error where
-
-------------------------------------------------------------------------------
-import           Control.Exception (SomeException)
-import           Control.Monad.CatchIO
-
-import           Prelude hiding (catch)
-
-import qualified Data.ByteString.Char8 as S
-
-------------------------------------------------------------------------------
-import           Snap.Iteratee
-import           Snap.Types
-
-
-------------------------------------------------------------------------------
--- | This function creates a simple plain text error page with the
--- provided content.  It sets the response status to 500, and
--- short-circuits further handling of the request
-internalError :: (MonadSnap m) => S.ByteString -> m a
-internalError msg =
-    let rsp = setContentType "text/plain; charset=utf-8"
-            . setContentLength (fromIntegral $ S.length msg)
-            . setResponseStatus 500 "Internal Server Error"
-            . modifyResponseBody (>. enumBS msg)
-            $ emptyResponse
-
-    in finishWith rsp
-
-
-------------------------------------------------------------------------------
--- | This function wraps a 'MonadSnap' handler so that if any
--- exceptions escape from it, the exception is rendered as an error
--- page and not propogated any further.
-catch500 :: (MonadSnap m) => m a -> m a
-catch500 action = action `catch` handler
-  where
-    handler :: (MonadSnap m) => SomeException -> m a
-    handler = internalError
-            . S.append "Unhandled error:\r\n\r\n"
-            . S.pack
-            . show
diff --git a/src/Snap/Loader/Hint.hs b/src/Snap/Loader/Hint.hs
index 7dbd97c..35b0718 100644
--- a/src/Snap/Loader/Hint.hs
+++ b/src/Snap/Loader/Hint.hs
@@ -31,7 +31,6 @@ import           Prelude hiding (catch)
 import           System.Environment (getArgs)
 
 ------------------------------------------------------------------------------
-import           Snap.Http.Server
 import           Snap.Types
 import qualified Snap.Loader.Static as Static
 
@@ -148,7 +147,7 @@ hintSnap opts modules initialization cleanup handler = do
     return $ do
         interpreterResult <- liftIO loadAction
         case interpreterResult of
-            Left err -> internalError $ format err
+            Left err -> error $ format err
             Right handlerAction -> handlerAction
 
 
-----------------------------------------------------------------------


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

Reply via email to