laktek / punch

A fun and easy way to build modern websites
http://laktek.github.com/punch
MIT License
1.17k stars 107 forks source link

Punch could catch LESS parsing errors #94

Open smola opened 10 years ago

smola commented 10 years ago

When running punch s it is sometimes annoying that it fully crashes when less parser throws an error. Punch could handle this so that an error page is returned.

laktek commented 10 years ago

I guess this is because you're using an old version of the Less npm module. From 1.4.1, Less module passes the error to callback, instead of raising the exception.

Also, try upgrading to latest Punch (0.5.37 or above), which should log Less parsing errors more descriptively.

smola commented 10 years ago

I have upgraded to Punch 0.5.37 and Less 1.4.2 and it still fails silently. The generated CSS file is empty and punch s just returns status 200.

The project where I've got this problem is here: https://github.com/smola/smola.github.io/tree/punch

bjfish commented 10 years ago

@laktek I think @smola is describing something like an in browser error page when parsing errors occur versus just logging to the console when template or css errors occur.

For example, here is an error page from the better_errors gem: image