@@ -330,8 +330,7 @@ downloadOrRead sourceURL s = do
330 convertSlash x = x
330 convertSlash x = x
332withPaths :: PandocMonad m => [FilePath] -> (FilePath -> m a) -> FilePath -> m a
332withPaths :: PandocMonad m => [FilePath] -> (FilePath -> m a) -> FilePath -> m a
333−withPaths [] _ fp = throwError $ PandocIOError fp
333+withPaths [] _ fp = throwError $ PandocResourceNotFound fp
334− (userError "file not found in resource path")
335withPaths (p:ps) action fp =
334withPaths (p:ps) action fp =
336 catchError (action (p </> fp))
335 catchError (action (p </> fp))
337 (\_ -> withPaths ps action fp)
336 (\_ -> withPaths ps action fp)
@@ -433,20 +432,17 @@ instance PandocMonad PandocPure where
433 modifyPureState $ \st -> st { stUniqStore = us }
432 modifyPureState $ \st -> st { stUniqStore = us }
435 _ -> M.fail "uniq store ran out of elements"
434 _ -> M.fail "uniq store ran out of elements"
436− openURL u = throwError $ PandocIOError u $
435+ openURL u = throwError $ PandocResourceNotFound u
437− userError "Cannot open URL in PandocPure"
438 readFileLazy fp = do
436 readFileLazy fp = do
439 fps <- getsPureState stFiles
437 fps <- getsPureState stFiles
440 case infoFileContents <$> getFileInfo fp fps of
438 case infoFileContents <$> getFileInfo fp fps of
441 Just bs -> return (BL.fromStrict bs)
439 Just bs -> return (BL.fromStrict bs)
442− Nothing -> throwError $ PandocIOError fp
440+ Nothing -> throwError $ PandocResourceNotFound fp
443− (userError "File not found in PureState")
444 readFileStrict fp = do
441 readFileStrict fp = do
445 fps <- getsPureState stFiles
442 fps <- getsPureState stFiles
446 case infoFileContents <$> getFileInfo fp fps of
443 case infoFileContents <$> getFileInfo fp fps of
447 Just bs -> return bs
444 Just bs -> return bs
448− Nothing -> throwError $ PandocIOError fp
445+ Nothing -> throwError $ PandocResourceNotFound fp
449− (userError "File not found in PureState")
450 readDataFile Nothing "reference.docx" = do
446 readDataFile Nothing "reference.docx" = do
451 (B.concat . BL.toChunks . fromArchive) <$> getsPureState stReferenceDocx
447 (B.concat . BL.toChunks . fromArchive) <$> getsPureState stReferenceDocx
452 readDataFile Nothing "reference.odt" = do
448 readDataFile Nothing "reference.odt" = do