foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

Throw errors while compiling templates instead of logging to the console #153

Closed kazagkazag closed 6 years ago

kazagkazag commented 6 years ago

I use panini to render templates for emails, so I have entire pipeline to prepare, build and fill in templates. But when I make a typo, build will pass anyway, with broken template.

Line responsible for that behavior is there:

https://github.com/zurb/panini/blob/37b78d50a6eb4e89873ad9780f85279fe875363a/lib/render.js#L81

I think that panini should throw an error instead of logging to the console. "Fail-fast" would be the best way to handle errors, otherwise we ended up with broken template, but entire build pipeline succeeded and application tried to use broken template...

I could make PR if needed, just let me know.

gakimball commented 6 years ago

I'm focused on trying to ship v2 of Panini, so I can't devote any time to working on the old version, but I'll take a PR 👌

gakimball commented 6 years ago

Fixed via #157, thank you! I deployed version 1.6.1 with this change.