{"action":"created","issue":{"url":"https://api.github.com/repos/MetricsGrimoire/sortinghat/issues/19","labels_url":"https://api.github.com/repos/MetricsGrimoire/sortinghat/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/MetricsGrimoire/sortinghat/issues/19/comments","events_url":"https://api.github.com/repos/MetricsGrimoire/sortinghat/issues/19/events","html_url":"https://github.com/MetricsGrimoire/sortinghat/pull/19","id":112017034,"number":19,"title":"Support for specific error codes for Add command","user":{"login":"andygrunwald","id":320064,"avatar_url":"https://avatars.githubusercontent.com/u/320064?v=3","gravatar_id":"","url":"https://api.github.com/users/andygrunwald","html_url":"https://github.com/andygrunwald","followers_url":"https://api.github.com/users/andygrunwald/followers","following_url":"https://api.github.com/users/andygrunwald/following{/other_user}","gists_url":"https://api.github.com/users/andygrunwald/gists{/gist_id}","starred_url":"https://api.github.com/users/andygrunwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andygrunwald/subscriptions","organizations_url":"https://api.github.com/users/andygrunwald/orgs","repos_url":"https://api.github.com/users/andygrunwald/repos","events_url":"https://api.github.com/users/andygrunwald/events{/privacy}","received_events_url":"https://api.github.com/users/andygrunwald/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-18T12:35:48Z","updated_at":"2015-10-19T22:40:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MetricsGrimoire/sortinghat/pulls/19","html_url":"https://github.com/MetricsGrimoire/sortinghat/pull/19","diff_url":"https://github.com/MetricsGrimoire/sortinghat/pull/19.diff","patch_url":"https://github.com/MetricsGrimoire/sortinghat/pull/19.patch"},"body":"All commands for sortinghat return an exit code after the operation is finished:\r\n* 0 for success\r\n* 1 for failure\r\n\r\nIn the linux / unix world every exit code > 0 means failure.\r\nThe problem with the current approach is: You can`t identity what kind of error happen, because every error is exit code 1.\r\n\r\nIn my current project ([andygrunwald/apihat](https://github.com/andygrunwald/apihat) - A REST(ful) API for MetricsGrimoire/sortinghat) i need to know what was going wrong. Was it a already existing entity? Or a database error?\r\nThe REST API should handle the cases differently.\r\nOf course there is a text that can be parsed. But depending on a text is kind of difficult and dangerous.\r\n\r\nThis Pull Request offers specific error codes for the Add command.\r\nThe interface / exit codes for the command line won't be changed.\r\nOnly the call to `add` (in the Add command) returns the new error codes.\r\n\r\nOnly the Add command was handled, because i want to get your opinion and rate of accept of this PR first (instead of wasting hours over hours to implement the other commands).\r\nIf you accept this PR i will take case of the other commands in the same way."},"comment":{"url":"https://api.github.com/repos/MetricsGrimoire/sortinghat/issues/comments/149367807","html_url":"https://github.com/MetricsGrimoire/sortinghat/pull/19#issuecomment-149367807","issue_url":"https://api.github.com/repos/MetricsGrimoire/sortinghat/issues/19","id":149367807,"user":{"login":"jgbarah","id":1039693,"avatar_url":"https://avatars.githubusercontent.com/u/1039693?v=3","gravatar_id":"","url":"https://api.github.com/users/jgbarah","html_url":"https://github.com/jgbarah","followers_url":"https://api.github.com/users/jgbarah/followers","following_url":"https://api.github.com/users/jgbarah/following{/other_user}","gists_url":"https://api.github.com/users/jgbarah/gists{/gist_id}","starred_url":"https://api.github.com/users/jgbarah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgbarah/subscriptions","organizations_url":"https://api.github.com/users/jgbarah/orgs","repos_url":"https://api.github.com/users/jgbarah/repos","events_url":"https://api.github.com/users/jgbarah/events{/privacy}","received_events_url":"https://api.github.com/users/jgbarah/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T22:40:45Z","updated_at":"2015-10-19T22:40:45Z","body":"Great! Thanks for the clarification."}}