diff options
-rw-r--r-- | src/Hakyll/Core/Compiler.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs index 79ebb5e..5fb7b01 100644 --- a/src/Hakyll/Core/Compiler.hs +++ b/src/Hakyll/Core/Compiler.hs @@ -181,8 +181,14 @@ getRouteFor = fromJob $ \identifier -> CompilerM $ do -- getResourceString :: Compiler Resource String getResourceString = fromJob $ \resource -> CompilerM $ do + let identifier = unResource resource provider <- compilerResourceProvider <$> ask - liftIO $ resourceString provider resource + if resourceExists provider identifier + then liftIO $ resourceString provider resource + else throwError $ error' identifier + where + error' id' = "Hakyll.Core.Compiler.getResourceString: resource " + ++ show id' ++ " not found" -- | Auxiliary: get a dependency -- |