diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Class.hs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs index f7915b27d..0135ac6b3 100644 --- a/src/Text/Pandoc/Class.hs +++ b/src/Text/Pandoc/Class.hs @@ -105,7 +105,7 @@ getPOSIXTime = utcTimeToPOSIXSeconds <$> getCurrentTime -- We can add to this as we go data PandocExecutionError = PandocFileReadError String - deriving Show + deriving (Show, Typeable) -- Nothing in this for now, but let's put it there anyway. data PandocStateIO = PandocStateIO @@ -174,10 +174,7 @@ data TestEnv = TestEnv { envEnv :: [(String, String)] , envFontFiles :: [FilePath] } -data TestException = TestException - deriving (Show, Typeable) - -instance E.Exception TestException +instance E.Exception PandocExecutionError newtype PandocPure a = PandocPure { unPandocPure :: ExceptT PandocExecutionError @@ -230,7 +227,7 @@ instance PandocMonad PandocPure where fps <- asks envFiles case lookup fp fps of Just bs -> return (Right (bs, getMimeType fp)) - Nothing -> return (Left $ E.toException TestException) + Nothing -> return (Left $ E.toException $ PandocFileReadError "oops") fetchItem' media sourceUrl nm = do case lookupMedia nm media of |