{"action":"opened","number":5,"pull_request":{"url":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls/5","id":42931235,"html_url":"https://github.com/balbeko/hubot-jenkins/pull/5","diff_url":"https://github.com/balbeko/hubot-jenkins/pull/5.diff","patch_url":"https://github.com/balbeko/hubot-jenkins/pull/5.patch","issue_url":"https://api.github.com/repos/balbeko/hubot-jenkins/issues/5","number":5,"state":"open","locked":false,"title":"Print error on authentication failure (401)","user":{"login":"ecksun","id":135807,"avatar_url":"https://avatars.githubusercontent.com/u/135807?v=3","gravatar_id":"","url":"https://api.github.com/users/ecksun","html_url":"https://github.com/ecksun","followers_url":"https://api.github.com/users/ecksun/followers","following_url":"https://api.github.com/users/ecksun/following{/other_user}","gists_url":"https://api.github.com/users/ecksun/gists{/gist_id}","starred_url":"https://api.github.com/users/ecksun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecksun/subscriptions","organizations_url":"https://api.github.com/users/ecksun/orgs","repos_url":"https://api.github.com/users/ecksun/repos","events_url":"https://api.github.com/users/ecksun/events{/privacy}","received_events_url":"https://api.github.com/users/ecksun/received_events","type":"User","site_admin":false},"body":"When jenkins returns a 401 it gives a HTML response, which JSON.parse throws on, which in turn causes the very readable error message:\r\n\r\n    SyntaxError: Unexpected token <\r\n\r\nNow it should instead read:\r\n\r\n    Invalid credentials","created_at":"2015-08-20T13:49:33Z","updated_at":"2015-08-20T13:49:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls/5/commits","review_comments_url":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls/5/comments","review_comment_url":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/balbeko/hubot-jenkins/issues/5/comments","statuses_url":"https://api.github.com/repos/balbeko/hubot-jenkins/statuses/4a944e755cfa942638e4e8efe6e57871061c1089","head":{"label":"Scypho:auth_fail_error","ref":"auth_fail_error","sha":"4a944e755cfa942638e4e8efe6e57871061c1089","user":{"login":"Scypho","id":9363024,"avatar_url":"https://avatars.githubusercontent.com/u/9363024?v=3","gravatar_id":"","url":"https://api.github.com/users/Scypho","html_url":"https://github.com/Scypho","followers_url":"https://api.github.com/users/Scypho/followers","following_url":"https://api.github.com/users/Scypho/following{/other_user}","gists_url":"https://api.github.com/users/Scypho/gists{/gist_id}","starred_url":"https://api.github.com/users/Scypho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scypho/subscriptions","organizations_url":"https://api.github.com/users/Scypho/orgs","repos_url":"https://api.github.com/users/Scypho/repos","events_url":"https://api.github.com/users/Scypho/events{/privacy}","received_events_url":"https://api.github.com/users/Scypho/received_events","type":"Organization","site_admin":false},"repo":{"id":41097286,"name":"hubot-jenkins","full_name":"Scypho/hubot-jenkins","owner":{"login":"Scypho","id":9363024,"avatar_url":"https://avatars.githubusercontent.com/u/9363024?v=3","gravatar_id":"","url":"https://api.github.com/users/Scypho","html_url":"https://github.com/Scypho","followers_url":"https://api.github.com/users/Scypho/followers","following_url":"https://api.github.com/users/Scypho/following{/other_user}","gists_url":"https://api.github.com/users/Scypho/gists{/gist_id}","starred_url":"https://api.github.com/users/Scypho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scypho/subscriptions","organizations_url":"https://api.github.com/users/Scypho/orgs","repos_url":"https://api.github.com/users/Scypho/repos","events_url":"https://api.github.com/users/Scypho/events{/privacy}","received_events_url":"https://api.github.com/users/Scypho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Scypho/hubot-jenkins","description":"","fork":true,"url":"https://api.github.com/repos/Scypho/hubot-jenkins","forks_url":"https://api.github.com/repos/Scypho/hubot-jenkins/forks","keys_url":"https://api.github.com/repos/Scypho/hubot-jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Scypho/hubot-jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Scypho/hubot-jenkins/teams","hooks_url":"https://api.github.com/repos/Scypho/hubot-jenkins/hooks","issue_events_url":"https://api.github.com/repos/Scypho/hubot-jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/Scypho/hubot-jenkins/events","assignees_url":"https://api.github.com/repos/Scypho/hubot-jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/Scypho/hubot-jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/Scypho/hubot-jenkins/tags","blobs_url":"https://api.github.com/repos/Scypho/hubot-jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Scypho/hubot-jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Scypho/hubot-jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/Scypho/hubot-jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Scypho/hubot-jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/Scypho/hubot-jenkins/languages","stargazers_url":"https://api.github.com/repos/Scypho/hubot-jenkins/stargazers","contributors_url":"https://api.github.com/repos/Scypho/hubot-jenkins/contributors","subscribers_url":"https://api.github.com/repos/Scypho/hubot-jenkins/subscribers","subscription_url":"https://api.github.com/repos/Scypho/hubot-jenkins/subscription","commits_url":"https://api.github.com/repos/Scypho/hubot-jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/Scypho/hubot-jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/Scypho/hubot-jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/Scypho/hubot-jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/Scypho/hubot-jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/Scypho/hubot-jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Scypho/hubot-jenkins/merges","archive_url":"https://api.github.com/repos/Scypho/hubot-jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Scypho/hubot-jenkins/downloads","issues_url":"https://api.github.com/repos/Scypho/hubot-jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/Scypho/hubot-jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/Scypho/hubot-jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/Scypho/hubot-jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Scypho/hubot-jenkins/labels{/name}","releases_url":"https://api.github.com/repos/Scypho/hubot-jenkins/releases{/id}","created_at":"2015-08-20T13:31:09Z","updated_at":"2015-08-20T13:31:09Z","pushed_at":"2015-08-20T13:48:19Z","git_url":"git://github.com/Scypho/hubot-jenkins.git","ssh_url":"git@github.com:Scypho/hubot-jenkins.git","clone_url":"https://github.com/Scypho/hubot-jenkins.git","svn_url":"https://github.com/Scypho/hubot-jenkins","homepage":null,"size":86,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"balbeko:master","ref":"master","sha":"f76df98779a13b280717ed877b361e51e5908e6a","user":{"login":"balbeko","id":160631,"avatar_url":"https://avatars.githubusercontent.com/u/160631?v=3","gravatar_id":"","url":"https://api.github.com/users/balbeko","html_url":"https://github.com/balbeko","followers_url":"https://api.github.com/users/balbeko/followers","following_url":"https://api.github.com/users/balbeko/following{/other_user}","gists_url":"https://api.github.com/users/balbeko/gists{/gist_id}","starred_url":"https://api.github.com/users/balbeko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balbeko/subscriptions","organizations_url":"https://api.github.com/users/balbeko/orgs","repos_url":"https://api.github.com/users/balbeko/repos","events_url":"https://api.github.com/users/balbeko/events{/privacy}","received_events_url":"https://api.github.com/users/balbeko/received_events","type":"User","site_admin":false},"repo":{"id":22433787,"name":"hubot-jenkins","full_name":"balbeko/hubot-jenkins","owner":{"login":"balbeko","id":160631,"avatar_url":"https://avatars.githubusercontent.com/u/160631?v=3","gravatar_id":"","url":"https://api.github.com/users/balbeko","html_url":"https://github.com/balbeko","followers_url":"https://api.github.com/users/balbeko/followers","following_url":"https://api.github.com/users/balbeko/following{/other_user}","gists_url":"https://api.github.com/users/balbeko/gists{/gist_id}","starred_url":"https://api.github.com/users/balbeko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balbeko/subscriptions","organizations_url":"https://api.github.com/users/balbeko/orgs","repos_url":"https://api.github.com/users/balbeko/repos","events_url":"https://api.github.com/users/balbeko/events{/privacy}","received_events_url":"https://api.github.com/users/balbeko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balbeko/hubot-jenkins","description":"","fork":false,"url":"https://api.github.com/repos/balbeko/hubot-jenkins","forks_url":"https://api.github.com/repos/balbeko/hubot-jenkins/forks","keys_url":"https://api.github.com/repos/balbeko/hubot-jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balbeko/hubot-jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balbeko/hubot-jenkins/teams","hooks_url":"https://api.github.com/repos/balbeko/hubot-jenkins/hooks","issue_events_url":"https://api.github.com/repos/balbeko/hubot-jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/balbeko/hubot-jenkins/events","assignees_url":"https://api.github.com/repos/balbeko/hubot-jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/balbeko/hubot-jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/balbeko/hubot-jenkins/tags","blobs_url":"https://api.github.com/repos/balbeko/hubot-jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balbeko/hubot-jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balbeko/hubot-jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/balbeko/hubot-jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balbeko/hubot-jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/balbeko/hubot-jenkins/languages","stargazers_url":"https://api.github.com/repos/balbeko/hubot-jenkins/stargazers","contributors_url":"https://api.github.com/repos/balbeko/hubot-jenkins/contributors","subscribers_url":"https://api.github.com/repos/balbeko/hubot-jenkins/subscribers","subscription_url":"https://api.github.com/repos/balbeko/hubot-jenkins/subscription","commits_url":"https://api.github.com/repos/balbeko/hubot-jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/balbeko/hubot-jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/balbeko/hubot-jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/balbeko/hubot-jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/balbeko/hubot-jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/balbeko/hubot-jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balbeko/hubot-jenkins/merges","archive_url":"https://api.github.com/repos/balbeko/hubot-jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balbeko/hubot-jenkins/downloads","issues_url":"https://api.github.com/repos/balbeko/hubot-jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/balbeko/hubot-jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/balbeko/hubot-jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balbeko/hubot-jenkins/labels{/name}","releases_url":"https://api.github.com/repos/balbeko/hubot-jenkins/releases{/id}","created_at":"2014-07-30T15:33:18Z","updated_at":"2015-06-18T06:38:34Z","pushed_at":"2015-08-20T13:32:04Z","git_url":"git://github.com/balbeko/hubot-jenkins.git","ssh_url":"git@github.com:balbeko/hubot-jenkins.git","clone_url":"https://github.com/balbeko/hubot-jenkins.git","svn_url":"https://github.com/balbeko/hubot-jenkins","homepage":null,"size":178,"stargazers_count":3,"watchers_count":3,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls/5"},"html":{"href":"https://github.com/balbeko/hubot-jenkins/pull/5"},"issue":{"href":"https://api.github.com/repos/balbeko/hubot-jenkins/issues/5"},"comments":{"href":"https://api.github.com/repos/balbeko/hubot-jenkins/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/balbeko/hubot-jenkins/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/balbeko/hubot-jenkins/statuses/4a944e755cfa942638e4e8efe6e57871061c1089"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":8,"deletions":0,"changed_files":1}}