{"action":"opened","issue":{"url":"https://api.github.com/repos/RIAEvangelist/node-cmd/issues/32","repository_url":"https://api.github.com/repos/RIAEvangelist/node-cmd","labels_url":"https://api.github.com/repos/RIAEvangelist/node-cmd/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/RIAEvangelist/node-cmd/issues/32/comments","events_url":"https://api.github.com/repos/RIAEvangelist/node-cmd/issues/32/events","html_url":"https://github.com/RIAEvangelist/node-cmd/issues/32","id":298254832,"number":32,"title":"Get cmd's response in error condition","user":{"login":"lance-shi","id":8774316,"avatar_url":"https://avatars0.githubusercontent.com/u/8774316?v=4","gravatar_id":"","url":"https://api.github.com/users/lance-shi","html_url":"https://github.com/lance-shi","followers_url":"https://api.github.com/users/lance-shi/followers","following_url":"https://api.github.com/users/lance-shi/following{/other_user}","gists_url":"https://api.github.com/users/lance-shi/gists{/gist_id}","starred_url":"https://api.github.com/users/lance-shi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lance-shi/subscriptions","organizations_url":"https://api.github.com/users/lance-shi/orgs","repos_url":"https://api.github.com/users/lance-shi/repos","events_url":"https://api.github.com/users/lance-shi/events{/privacy}","received_events_url":"https://api.github.com/users/lance-shi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-19T12:14:30Z","updated_at":"2018-02-19T12:14:30Z","closed_at":null,"author_association":"NONE","body":"I am trying to get cmd's response in both success and error conditions. I am having the following code: \r\n\r\n```\r\nconst cmd = require('node-cmd');\r\nconst Promise = require('bluebird');\r\n\r\nconst getAsync = Promise.promisify(cmd.get, { multiArgs: true, context: cmd });\r\n\r\ngetAsync('sfdx force:source:status --json').then(data => {\r\n    console.log('success');\r\n    console.dir(data);\r\n}).catch(err => {\r\n    console.log('error');\r\n    console.log(err.message);\r\n});\r\n```\r\n\r\nI am trying to get the json output in error conditions as well. However, when error happens, it is hard to retrieve that. Any idea about how to walk around this issue? "}}
{"actor":{"display_login":"lance-shi"}}