visionmedia/jade — Issue #506: rethrow() doesn't catch() its own internal errors
Author: dobesv
Created: 2012-02-16 01:28:12+00:00
State: open

Just got this trace:

```
Error: UNKNOWN, unknown error 'F:\projects oodjing oodjingsrcmainjadeorder-editable.jade'
at Object.openSync (fs.js:230:18)
at Object.readFileSync (fs.js:120:15)
at rethrow (F:\projects\foodjing\foodjing\src\main\nodejs\node_modules\jade\lib\runtime.js:99:27)
at eval at (F:\projects\foodjing\foodjing\src\main\nodejs\node_modules\jade\lib\jade.js:161:8)
at Object. (F:\projects\foodjing\foodjing\src\main\nodejs\node_modules\jade\lib\jade.js:166:12)
at ServerResponse._render (F:\projects\foodjing\foodjing\src\main\nodejs\node_modules\express\lib\view.js:422:21)
at ServerResponse.render (F:\projects\foodjing\foodjing\src\main\nodejs\node_modules\express\lib\view.js:315:17)
at F:\projects\foodjing\foodjing\src\main\nodejs\controllers\order.js:10:17
at callbacks (F:\projects\foodjing\foodjing\src\main\nodejs\node_modules\express\lib\router\index.js:272:11)
at param (F:\projects\foodjing\foodjing\src\main\nodejs\node_modules\express\lib\router\index.js:246:11)
```

Not sure of the root cause, but the original error is apparently squashed because of an error inside rethrow(). A try { .. } catch { ... } would be helpful, where if an error occurs it can do something different.