From e6a03cdd4bd36cb3baceb226125b89a422ab0a09 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 3 Mar 2012 08:16:16 -0800 Subject: EPUB writer: Use extensible exceptions. --- src/Text/Pandoc/Writers/EPUB.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 67048348e..a04172a6d 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -48,6 +48,8 @@ import Text.Pandoc.Writers.Markdown ( writePlain ) import Data.Char ( toLower ) import Network.URI ( unEscapeString ) import Text.Pandoc.MIME (getMimeType) +import Prelude hiding (catch) +import Control.Exception (catch, SomeException) -- | Produce an EPUB file from a Pandoc document. writeEPUB :: Maybe String -- ^ EPUB stylesheet specified at command line @@ -127,7 +129,7 @@ writeEPUB mbStylesheet fonts opts doc@(Pandoc meta _) = do -- contents.opf localeLang <- catch (liftM (takeWhile (/='.')) $ getEnv "LANG") - (\_ -> return "en-US") + (\e -> let _ = (e :: SomeException) in return "en-US") let lang = case lookup "lang" (writerVariables opts') of Just x -> x Nothing -> localeLang -- cgit v1.2.3