on master help sign in
Better error message for Data.Yaml.Config #168
4210fa0Michael Snoyman
yaml/ChangeLog.md+4
@@ -1,5 +1,9 @@
1# ChangeLog for yaml
1# ChangeLog for yaml
2
2
3+## 0.11.0.1
4+
5+* Better error messages in the `Data.Yaml.Config` module [#168](https://github.com/snoyberg/yaml/issues/168)
6+
3## 0.11.0.0
7## 0.11.0.0
4
8
5* Split out the `libyaml` and `Text.Libyaml` code into its own package. [#145](https://github.com/snoyberg/yaml/issues/145)
9* Split out the `libyaml` and `Text.Libyaml` code into its own package. [#145](https://github.com/snoyberg/yaml/issues/145)
yaml/package.yaml+1−1
@@ -1,5 +1,5 @@
1name: yaml
1name: yaml
2−version: 0.11.0.0
2+version: 0.11.0.1
3synopsis: Support for parsing and rendering YAML documents.
3synopsis: Support for parsing and rendering YAML documents.
4description: README and API documentation are available at <https://www.stackage.org/package/yaml>
4description: README and API documentation are available at <https://www.stackage.org/package/yaml>
5category: Data
5category: Data
yaml/src/Data/Yaml/Config.hs+3−3
@@ -197,9 +197,9 @@ loadYamlSettings runTimeFiles compileValues envUsage = do
197 UseCustomEnv env -> return $ applyEnvValue False env value'
197 UseCustomEnv env -> return $ applyEnvValue False env value'
198 RequireCustomEnv env -> return $ applyEnvValue True env value'
198 RequireCustomEnv env -> return $ applyEnvValue True env value'
199
199
200− case fromJSON value of
200+ case Y.parseEither parseJSON value of
201− Error s -> error $ "Could not convert to expected type: " ++ s
201+ Left s -> error $ "Could not convert to expected type: " ++ s
202− Success settings -> return settings
202+ Right settings -> return settings
203
203
204-- | Same as @loadYamlSettings@, but get the list of runtime config files from
204-- | Same as @loadYamlSettings@, but get the list of runtime config files from
205-- the command line arguments.
205-- the command line arguments.