ameen3/node-mtgox-apiv2 — pull request #19 by askmike (2013-07-21 16:34:52+00:00)
Title: fix crash on faulty API response

To prevent this:

mike@vps674:~/nodeprojects/gekko/c$ cat mtgox.err

/home/mike/nodeprojects/gekko/node_modules/mtgox-apiv2/mtgox.js:50
callback(new Error("Request failed with " + res.statusCode));
^
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (/home/mike/nodeprojects/gekko/node_modules/mtgox-apiv2/mtgox.js:50:58)
at Request.init.self.callback (/home/mike/nodeprojects/gekko/node_modules/mtgox-apiv2/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:88:17)
at ClientRequest.Request.init.self.clientErrorHandler (/home/mike/nodeprojects/gekko/node_modules/mtgox-apiv2/node_modules/request/index.js:257:10)
at ClientRequest.EventEmitter.emit (events.js:88:17)
at CleartextStream.socketErrorListener (http.js:1330:9)
at CleartextStream.EventEmitter.emit (events.js:88:17)
at SecurePair.exports.connect.cleartext._controlReleased (tls.js:1267:15)
at SecurePair.EventEmitter.emit (events.js:88:17)
at SecurePair.error (tls.js:921:10)