@@ -48,6 +48,7 @@ import Data.List ( intercalate, isSuffixOf, isPrefixOf )
4848import System.Directory ( getAppUserDataDirectory, doesFileExist, findExecutable )
4949import System.IO ( stdout )
5050import System.IO.Error ( isDoesNotExistError )
51+import qualified Control.Exception as E
5152import Control.Exception.Extensible ( throwIO )
5253import qualified Text.Pandoc.UTF8 as UTF8
5354import qualified Text.CSL as CSL
@@ -840,9 +841,10 @@ main = do
840841 let sources = if ignoreArgs then [] else args
841842
842843 datadir <- case mbDataDir of
843− Nothing -> catch
844+ Nothing -> E.catch
844845 (liftM Just $ getAppUserDataDirectory "pandoc")
845− (const $ return Nothing)
846+ (\e -> let _ = (e :: E.SomeException)
847+ in return Nothing)
846848 Just _ -> return mbDataDir
847849
848850 -- assign reader and writer based on options and filenames
@@ -893,12 +895,13 @@ main = do
893895 let tp' = case takeExtension tp of
894896 "" -> tp <.> format
895897 _ -> tp
896− catch (UTF8.readFile tp')
898+ E.catch (UTF8.readFile tp')
897899 (\e -> if isDoesNotExistError e
898− then catch
900+ then E.catch
899901 (readDataFile datadir $
900902 "templates" </> tp')
901− (\_ -> throwIO e)
903+ (\e' -> let _ = (e' :: E.SomeException)
904+ in throwIO e')
902905 else throwIO e)
903906
904907 variables' <- case mathMethod of
@@ -922,8 +925,10 @@ main = do
922925 -- that we can do lookups with regular string equality
923926 let unescapeRefId ref = ref{ refId = fromEntities (refId ref) }
924927
925− refs <- mapM (\f -> catch (CSL.readBiblioFile f) $ \e ->
926− err 23 $ "Error reading bibliography `" ++ f ++ "'" ++ "\n" ++ show e)
928+ refs <- mapM (\f -> E.catch (CSL.readBiblioFile f)
929+ (\e -> let _ = (e :: E.SomeException)
930+ in err 23 $ "Error reading bibliography `" ++ f ++
931+ "'" ++ "\n" ++ show e))
927932 reffiles >>=
928933 return . map unescapeRefId . concat
929934