From a8f054657448348ef8564d06958269fd4cf1adb9 Mon Sep 17 00:00:00 2001 From: bjorn Date: Sun, 24 Aug 2008 19:12:44 +0000 Subject: Move CGIError stuff to FastCGIUtils. --- src/server/MainFastCGI.hs | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/server/MainFastCGI.hs') diff --git a/src/server/MainFastCGI.hs b/src/server/MainFastCGI.hs index b7af9fce4..5e9dd1cee 100644 --- a/src/server/MainFastCGI.hs +++ b/src/server/MainFastCGI.hs @@ -9,9 +9,7 @@ import Network.CGI import Text.JSON import qualified Codec.Binary.UTF8.String as UTF8 (encodeString) -import Control.Exception import Control.Monad -import Data.Dynamic import qualified Data.Map as Map import Data.Maybe @@ -127,21 +125,6 @@ linearize' pgf mto tree = Nothing -> PGF.linearizeAllLang pgf tree Just to -> [(to,PGF.linearize pgf to tree)] --- * General CGI Error exception mechanism - -data CGIError = CGIError { cgiErrorCode :: Int, cgiErrorMessage :: String, cgiErrorText :: [String] } - deriving Typeable - -throwCGIError :: Int -> String -> [String] -> CGI a -throwCGIError c m t = throwCGI $ DynException $ toDyn $ CGIError c m t - -handleCGIErrors :: CGI CGIResult -> CGI CGIResult -handleCGIErrors x = x `catchCGI` \e -> case e of - DynException d -> case fromDynamic d of - Nothing -> throw e - Just (CGIError c m t) -> outputError c m t - _ -> throw e - -- * General CGI and JSON stuff outputJSON :: JSON a => a -> CGI CGIResult -- cgit v1.2.3