summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@community.haskell.org>2013-03-09 21:38:14 +0000
committerSergei Trofimovich <slyfox@community.haskell.org>2013-03-09 21:38:14 +0000
commit576b19aab5ff16b44c70e5b1d77bc65190dac056 (patch)
treeeef956b7b6a2fa92682edd9535b287da3904d89c /src/server
parent5b688b635993ca7308221aef852fac84fc102847 (diff)
ghc-7.6: fix src/server/PGFService.hs (use catch from base-4 Control.Exception)
Diffstat (limited to 'src/server')
-rw-r--r--src/server/PGFService.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs
index a353207f1..b934717e6 100644
--- a/src/server/PGFService.hs
+++ b/src/server/PGFService.hs
@@ -16,7 +16,7 @@ import qualified Codec.Binary.UTF8.String as UTF8 (decodeString)
import qualified Data.ByteString.Lazy as BS
import Control.Concurrent
-import Control.Exception(evaluate)
+import qualified Control.Exception as E
import Control.Monad
import Control.Monad.State(State,evalState,get,put)
import Data.Char
@@ -31,6 +31,9 @@ import System.IO
import System.Directory(removeFile)
import Fold(fold) -- transfer function for OpenMath LaTeX
+catchIOE :: IO a -> (E.IOException -> IO a) -> IO a
+catchIOE = E.catch
+
logFile :: FilePath
logFile = "pgf-error.log"
@@ -154,7 +157,7 @@ doExternal Nothing input = throwCGIError 400 "Unknown external command" ["Unknow
doExternal (Just cmd) input =
do liftIO $ logError ("External command: "++cmd)
cmds <- liftIO $ (fmap lines $ readFile "external_services")
- `catch` const (return [])
+ `catchIOE` const (return [])
liftIO $ logError ("External services: "++show cmds)
if cmd `elem` cmds then ok else err
where
@@ -357,7 +360,7 @@ pipeIt2graphviz format code = do
-- fork off a thread to start consuming the output
output <- BS.hGetContents outh
outMVar <- newEmptyMVar
- _ <- forkIO $ evaluate (BS.length output) >> putMVar outMVar ()
+ _ <- forkIO $ E.evaluate (BS.length output) >> putMVar outMVar ()
-- now write and flush any input
hPutStr inh code