diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2016-04-06 15:03:54 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2016-04-06 15:03:54 +0200 |
commit | 292385b7e5eb265032983f0669e5050b4fa89557 (patch) | |
tree | 3d2c83739a74fa4cd168cf85ae63adf7488141dc /src/Hakyll/Core/Provider | |
parent | b903bd3014fe99f533037d474787567b3e41de9e (diff) | |
download | hakyll-292385b7e5eb265032983f0669e5050b4fa89557.tar.gz |
Hint for weird yaml error
Diffstat (limited to 'src/Hakyll/Core/Provider')
-rw-r--r-- | src/Hakyll/Core/Provider/Metadata.hs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Hakyll/Core/Provider/Metadata.hs b/src/Hakyll/Core/Provider/Metadata.hs index 97dbc9e..ca1cc6c 100644 --- a/src/Hakyll/Core/Provider/Metadata.hs +++ b/src/Hakyll/Core/Provider/Metadata.hs @@ -1,6 +1,7 @@ -------------------------------------------------------------------------------- -- | Internal module to parse metadata -{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE RecordWildCards #-} module Hakyll.Core.Provider.Metadata ( loadMetadata , parsePage @@ -140,4 +141,14 @@ instance Exception MetadataException -------------------------------------------------------------------------------- instance Show MetadataException where show (MetadataException fp err) = - fp ++ ": " ++ Yaml.prettyPrintParseException err + fp ++ ": " ++ Yaml.prettyPrintParseException err ++ hint + + where + hint = case err of + Yaml.InvalidYaml (Just (Yaml.YamlParseException {..})) + | yamlProblem == problem -> "\n" ++ + "Hint: if the metadata value contains characters such\n" ++ + "as ':' or '-', try enclosing it in quotes." + _ -> "" + + problem = "mapping values are not allowed in this context" |