nephics/noxmox — pull request #6 by mab-netdev (2012-09-07 17:12:32+00:00)
Title: Fixed file read error exception

Sometimes when using mox (0.1.8) I get the following error:

TypeError: Object 500 has no method 'emit'
at emitResponse (/Users/mike/SCM/github/xxx/node_modules/noxmox/mox.js:132:13)
at [object Object]. (/Users/mike/SCM/github/xxxr/node_modules/noxmox/mox.js:230:9)
at [object Object].emit (events.js:88:20)
at Object.oncomplete (fs.js:1077:12)

Problem is line 230 on v0.1.8 (and line 239 on v0.2.x) is this:

emitResponse(500, {code:'InternalError', msg:err.message});

whereas it should be this:

emitResponse(request, {code:500, err:{code:'InternalError', msg:err.message}});

This pull request is for the fix to 0.2.x