dhall-lang / dhall-haskell

Maintainable configuration files
https://dhall-lang.org/
BSD 3-Clause "New" or "Revised" License
907 stars 211 forks source link

dhall --ascii --plain does not work for errors #797

Open Profpatsch opened 5 years ago

Profpatsch commented 5 years ago

$ dhall --plain --ascii <<< ./foo.dhall

Use "dhall --explain" for detailed errors

↳ ./foo.dhall

Error: Expression doesn't match annotation

- Text
+ Natural

4 : Text

We’ve got unicode, and colors (the “Error” is still displayed in red).

Same with parser errros:

$ dhall --plain --ascii <<< ./generators.dhall

↳ ./generators.dhall

Error: Invalid input

/home/philip/kot/dhall/generators/generators.dhall:2:1:
  |
2 | <empty line>
  | ^
unexpected end of input
expecting expression or whitespace

(the Errors contains colors)

Gabriella439 commented 5 years ago

@Profpatsch: So currently the --ascii flag only affects stdout (i.e. the in-band program output). I don't expect the --ascii flag to be able to affect error messages until we clean up the exception hierarchy