davidchambers / tutor

JavaScript interface for the Gatherer card database
https://gatherer.wizards.com/
Do What The F*ck You Want To Public License
149 stars 18 forks source link

Uncaught exception in tutor.card with no network connection #45

Closed nicknovitski closed 11 years ago

nicknovitski commented 11 years ago
/Users/nick/dev/tutor/lib/gatherer/printings.js:17
      if (res.statusCode !== 200) {
             ^
TypeError: Cannot read property 'statusCode' of undefined
    at Request.module.exports [as _callback] (/Users/nick/dev/tutor/lib/gatherer/printings.js:17:14)
    at Request.init.self.callback (/Users/nick/dev/tutor/node_modules/request/main.js:122:22)
    at Request.EventEmitter.emit (events.js:88:17)
    at ClientRequest.Request.init.self.clientErrorHandler (/Users/nick/dev/tutor/node_modules/request/main.js:225:10)
    at ClientRequest.EventEmitter.emit (events.js:88:17)
    at Socket.socketErrorListener (http.js:1330:9)
    at Socket.EventEmitter.emit (events.js:88:17)
    at Socket.connect.require.lookup.addressType (net.js:697:16)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

By comparison, .set returns an error object to the callback under the same conditions, which seems like the right behavior.

aeosynth commented 11 years ago

fixed by https://github.com/aeosynth/tutor/commit/5b3fb129bf108b02accd64d3b5379fee1c679e13