Improve error reporting when config.json has syntax errors #47

Closed
adrinux opened this Issue Dec 7, 2012 · 0 comments

Comments

Projects
None yet
2 participants
@adrinux

adrinux commented Dec 7, 2012

When starting the punch server with 'punch s', if there is a syntax error in config.json a warning is given and punch falls back on the default config:

Cannot read the custom config: Error: ENOENT, stat 'config'
Using the default config.

However if you introduce a syntax error to config.json whilst developing the site you may end up with a different error that obfuscates the real problem somewhat. For example a missing comma in a stylesheet bundle might give 'Error: Content for combined.css not found'.

I'm not sure which config punch then uses, does it continue to use the custom config, or immediately fall back on the default?

It might me better not to fall back on the default config at all, ever, since a single error in config.json could cause multiple customisations to stop working, not just the one with the syntax error, again somewhat masking the real issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment