jenius/roots — pull request #506 by joshrowley (2014-06-18 16:02:20+00:00)
Title: EMFILE error catching fix

Roots currently fails silently on an `EMFILE, too many open files` error.

When the `EMFILE` error gets wrapped into an `Error` object, it **does not** have the `stack` property. Not only that, when `.stack` is called on the error object, **everything breaks** and the entire program exits.

I can't even use `if err.stack then ...` here, because `.stack` causes roots to crash. The only workaround I was able to find was checking if the property existed with `if 'stack' in err ....`.