cloudhead/less.js — pull request #1318 by davidcornu (2013-05-09 16:39:08+00:00)
Title: Catch errors thrown by root.toCSS() in less.render()

Calling `root.toCSS()` can cause a `LessError` to be thrown:
https://github.com/cloudhead/less.js/blob/master/lib/less/parser.js#L424

The `less.render()` function (which takes a callback or returns an `EventEmitter`) calls `toCSS()` without wrapping it in a try/catch block, which breaks node-style callback conventions and leads to a very cryptic `[object, Object]` being logged.
https://github.com/cloudhead/less.js/blob/master/lib/less/index.js#L24

Passes both `make test` and `make browser-test`.