diff options
Diffstat (limited to 'src/Hakyll/Core/Compiler.hs')
| -rw-r--r-- | src/Hakyll/Core/Compiler.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs index 3c62a3a..92fcff8 100644 --- a/src/Hakyll/Core/Compiler.hs +++ b/src/Hakyll/Core/Compiler.hs @@ -210,13 +210,12 @@ getResourceLBS = getResourceWith resourceLBS -- | Overloadable function for 'getResourceString' and 'getResourceLBS' -- -getResourceWith :: (ResourceProvider -> Resource -> IO a) - -> Compiler Resource a +getResourceWith :: (Resource -> IO a) -> Compiler Resource a getResourceWith reader = fromJob $ \r -> CompilerM $ do let filePath = unResource r provider <- compilerResourceProvider <$> ask if resourceExists provider r - then liftIO $ reader provider r + then liftIO $ reader r else throwError $ error' filePath where error' id' = "Hakyll.Core.Compiler.getResourceWith: resource " |
