If internet connection is down this causes an exception:
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (/Users/hek/git/nodebb-plugin-affiliate/node_modules/amazon-product-api/lib/index.js:19:21)
at self.callback (/Users/hek/git/nodebb-plugin-affiliate/node_modules/request/request.js:368:22)
at Request.emit (events.js:107:17)
at Request.onRequestError (/Users/hek/git/nodebb-plugin-affiliate/node_modules/request/request.js:1025:8)
at ClientRequest.emit (events.js:107:17)
at Socket.socketErrorListener (_http_client.js:271:9)
at Socket.emit (events.js:107:17)
at net.js:940:16
at process._tickDomainCallback (node.js:381:11)
Would be good to add a
!response
check on the following line. https://github.com/t3chnoboy/amazon-product-api/blob/master/lib/index.js#L19If internet connection is down this causes an exception: