{"action":"created","issue":{"url":"https://api.github.com/repos/ibm-messaging/iot-nodejs/issues/7","labels_url":"https://api.github.com/repos/ibm-messaging/iot-nodejs/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/ibm-messaging/iot-nodejs/issues/7/comments","events_url":"https://api.github.com/repos/ibm-messaging/iot-nodejs/issues/7/events","html_url":"https://github.com/ibm-messaging/iot-nodejs/issues/7","id":120492343,"number":7,"title":"ECONNREFUSED not handled","user":{"login":"lobando","id":1490096,"avatar_url":"https://avatars.githubusercontent.com/u/1490096?v=3","gravatar_id":"","url":"https://api.github.com/users/lobando","html_url":"https://github.com/lobando","followers_url":"https://api.github.com/users/lobando/followers","following_url":"https://api.github.com/users/lobando/following{/other_user}","gists_url":"https://api.github.com/users/lobando/gists{/gist_id}","starred_url":"https://api.github.com/users/lobando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lobando/subscriptions","organizations_url":"https://api.github.com/users/lobando/orgs","repos_url":"https://api.github.com/users/lobando/repos","events_url":"https://api.github.com/users/lobando/events{/privacy}","received_events_url":"https://api.github.com/users/lobando/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ibm-messaging/iot-nodejs/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"jeffdare","id":7148351,"avatar_url":"https://avatars.githubusercontent.com/u/7148351?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffdare","html_url":"https://github.com/jeffdare","followers_url":"https://api.github.com/users/jeffdare/followers","following_url":"https://api.github.com/users/jeffdare/following{/other_user}","gists_url":"https://api.github.com/users/jeffdare/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffdare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffdare/subscriptions","organizations_url":"https://api.github.com/users/jeffdare/orgs","repos_url":"https://api.github.com/users/jeffdare/repos","events_url":"https://api.github.com/users/jeffdare/events{/privacy}","received_events_url":"https://api.github.com/users/jeffdare/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-12-04T21:42:39Z","updated_at":"2015-12-09T05:58:26Z","closed_at":"2015-12-07T16:10:34Z","body":"Not sure if this is the expected behaviour but the library is not handling an ECONNREFUSED error and it's throwing out the exception (crashing the app). I used to be able to handle anything with an on 'error' callback.. but those are no longer supported.\r\n\r\n```\r\n[2015-12-04 21:11:26.487] [ERROR] [default] - Connection Error :: Error: connect ECONNREFUSED XXX.XXX.XXX.XXX:8883\r\n/usr/src/myapp/node_modules/ibmiotf/lib/IotfApplication.js:189\r\n\t\tthrow new Error(err);\r\n\t\t^\r\n\r\nError: Error: connect ECONNREFUSED XXX.XXX.XXX.XXX:8883\r\n    at MqttClient.<anonymous> (/usr/src/myapp/node_modules/ibmiotf/lib/IotfApplication.js:189:9)\r\n    at emitOne (events.js:77:13)\r\n    at MqttClient.emit (events.js:169:7)\r\n    at TLSSocket.handleTLSerrors (/usr/src/myapp/node_modules/ibmiotf/node_modules/mqtt/lib/connect/tls.js:32:18)\r\n    at emitOne (events.js:82:20)\r\n    at TLSSocket.emit (events.js:169:7)\r\n    at emitErrorNT (net.js:1250:8)\r\n    at doNTCallback2 (node.js:429:9)\r\n    at process._tickCallback (node.js:343:17)\r\n```"},"comment":{"url":"https://api.github.com/repos/ibm-messaging/iot-nodejs/issues/comments/163119552","html_url":"https://github.com/ibm-messaging/iot-nodejs/issues/7#issuecomment-163119552","issue_url":"https://api.github.com/repos/ibm-messaging/iot-nodejs/issues/7","id":163119552,"user":{"login":"jeffdare","id":7148351,"avatar_url":"https://avatars.githubusercontent.com/u/7148351?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffdare","html_url":"https://github.com/jeffdare","followers_url":"https://api.github.com/users/jeffdare/followers","following_url":"https://api.github.com/users/jeffdare/following{/other_user}","gists_url":"https://api.github.com/users/jeffdare/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffdare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffdare/subscriptions","organizations_url":"https://api.github.com/users/jeffdare/orgs","repos_url":"https://api.github.com/users/jeffdare/repos","events_url":"https://api.github.com/users/jeffdare/events{/privacy}","received_events_url":"https://api.github.com/users/jeffdare/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T05:58:26Z","updated_at":"2015-12-09T05:58:26Z","body":"Hi,\r\n\r\nIf you run *npm install ibmiotf*, you should get the latest version. Or run *npm update* on the existing repo to get the latest version. \r\nThanks!"}}