{"action":"created","issue":{"url":"https://api.github.com/repos/agilecrm/nodejs/issues/2","repository_url":"https://api.github.com/repos/agilecrm/nodejs","labels_url":"https://api.github.com/repos/agilecrm/nodejs/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/agilecrm/nodejs/issues/2/comments","events_url":"https://api.github.com/repos/agilecrm/nodejs/issues/2/events","html_url":"https://github.com/agilecrm/nodejs/issues/2","id":162020883,"number":2,"title":"Problem on duplicate contact","user":{"login":"mete89","id":7263595,"avatar_url":"https://avatars.githubusercontent.com/u/7263595?v=3","gravatar_id":"","url":"https://api.github.com/users/mete89","html_url":"https://github.com/mete89","followers_url":"https://api.github.com/users/mete89/followers","following_url":"https://api.github.com/users/mete89/following{/other_user}","gists_url":"https://api.github.com/users/mete89/gists{/gist_id}","starred_url":"https://api.github.com/users/mete89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mete89/subscriptions","organizations_url":"https://api.github.com/users/mete89/orgs","repos_url":"https://api.github.com/users/mete89/repos","events_url":"https://api.github.com/users/mete89/events{/privacy}","received_events_url":"https://api.github.com/users/mete89/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-23T20:54:36Z","updated_at":"2016-10-14T07:12:53Z","closed_at":null,"body":"In ContactAPI.prototype.add function when I try to create a new contact,\r\n\r\nIt returns \"Sorry, duplicate contact found with the same email address.\" with a success response. Then it tries to parse it  \r\n`var contacts = JSON.parse(body);`\r\n\r\ngets an exception and it says \"Unexpected token S\" and cant see real error."},"comment":{"url":"https://api.github.com/repos/agilecrm/nodejs/issues/comments/253726375","html_url":"https://github.com/agilecrm/nodejs/issues/2#issuecomment-253726375","issue_url":"https://api.github.com/repos/agilecrm/nodejs/issues/2","id":253726375,"user":{"login":"ernho","id":4853679,"avatar_url":"https://avatars.githubusercontent.com/u/4853679?v=3","gravatar_id":"","url":"https://api.github.com/users/ernho","html_url":"https://github.com/ernho","followers_url":"https://api.github.com/users/ernho/followers","following_url":"https://api.github.com/users/ernho/following{/other_user}","gists_url":"https://api.github.com/users/ernho/gists{/gist_id}","starred_url":"https://api.github.com/users/ernho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ernho/subscriptions","organizations_url":"https://api.github.com/users/ernho/orgs","repos_url":"https://api.github.com/users/ernho/repos","events_url":"https://api.github.com/users/ernho/events{/privacy}","received_events_url":"https://api.github.com/users/ernho/received_events","type":"User","site_admin":false},"created_at":"2016-10-14T07:12:53Z","updated_at":"2016-10-14T07:12:53Z","body":"@graut I am getting no Sorry, duplicate contact found with the same email address. I got   {\"error\":\"Unexpected token S\",\"stack\":\"SyntaxError: Unexpected token S\\n and was wondering what is happening. \r\n\r\nYou guys should handle better errors. This part                    \r\n var contacts = JSON.parse(body);\r\ncan always throw an error. can you change your code?\r\n\r\nMaybe I am going to refactor your code."}}
{"actor":{"display_login":"ernho"}}