Skip to content

Improve error messages for yaml parse errors #2374

@sjakobi

Description

@sjakobi
~/t/yaml-error $ cat stack.yaml 
resolver: lts-6.7
packages:
  - location: git: https://github.com/commercialhaskell/stack
~/t/yaml-error $ stack build
Could not parse '/home/simon/test/yaml-error/stack.yaml':
InvalidYaml (Just (YamlParseException {yamlProblem = "mapping values are not allowed in this context", yamlContext = "", yamlProblemMark = YamlMark {yamlIndex = 45, yamlLine = 2, yamlColumn = 17}}))
See http://docs.haskellstack.org/en/stable/yaml_configuration/.

At least we could use yaml's prettyPrintParseException to format the exception more nicely.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions