uzu
uzu copied to clipboard
YAML error messages are not helpful
I have a project with ~50 templates. There's an error somewhere in a YAML snippet, but all Uzu tells me is:
Couldn't parse YAML
in sub build at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/B64B70030D8DC8D24494E45C38BA972A87CF0732 (Uzu::Render) line 267
in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/A6A04D2AC064A3AC3AC0CFA1813B60BA00E99C28 (Uzu::CLI) line 38
in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/2FA4F1086B130C49B85739217FDF9182FFBCD515 line 5
in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
I would like to know what file is failing, and (ideally) on what line number the parse fails.
Hi @evanmiller, I have added a catch to spit out the template name that it dies on for now. I am going to look into a solution for validating the yaml before trying to parse it. YAMLish doesn't support this yet.
Uzu will still die, but you should now see a message like this:
Invalid template yaml [/example_project_tt/pages/index.tt]
Thanks, much better! I will leave this open until line numbers are provided.