{"action":"created","comment":{"url":"https://api.github.com/repos/WISVCH/chue/pulls/comments/53930225","id":53930225,"diff_hunk":"@@ -43,6 +46,10 @@\n      * @param lightIdentifiers the lights to apply the state to\n      */\n     public void loadState(HueState state, String... lightIdentifiers) {\n+        if (!hueFacade.bridgeAvailable()) {\n+            throw new StateNotLoadedException(\"Hue bridge is not available\");","path":"src/main/java/ch/wisv/chue/HueService.java","position":28,"original_position":28,"commit_id":"f13d423ed26d7916e7b96bd468ef42b5d2baafa0","original_commit_id":"f13d423ed26d7916e7b96bd468ef42b5d2baafa0","user":{"login":"praseodym","id":20283,"avatar_url":"https://avatars.githubusercontent.com/u/20283?v=3","gravatar_id":"","url":"https://api.github.com/users/praseodym","html_url":"https://github.com/praseodym","followers_url":"https://api.github.com/users/praseodym/followers","following_url":"https://api.github.com/users/praseodym/following{/other_user}","gists_url":"https://api.github.com/users/praseodym/gists{/gist_id}","starred_url":"https://api.github.com/users/praseodym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praseodym/subscriptions","organizations_url":"https://api.github.com/users/praseodym/orgs","repos_url":"https://api.github.com/users/praseodym/repos","events_url":"https://api.github.com/users/praseodym/events{/privacy}","received_events_url":"https://api.github.com/users/praseodym/received_events","type":"User","site_admin":false},"body":"It would be nice to move this into e.g. an annotation, but that might be something for later.","created_at":"2016-02-24T12:18:31Z","updated_at":"2016-02-24T12:18:31Z","html_url":"https://github.com/WISVCH/chue/pull/37#discussion_r53930225","pull_request_url":"https://api.github.com/repos/WISVCH/chue/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/WISVCH/chue/pulls/comments/53930225"},"html":{"href":"https://github.com/WISVCH/chue/pull/37#discussion_r53930225"},"pull_request":{"href":"https://api.github.com/repos/WISVCH/chue/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/WISVCH/chue/pulls/37","id":60499569,"html_url":"https://github.com/WISVCH/chue/pull/37","diff_url":"https://github.com/WISVCH/chue/pull/37.diff","patch_url":"https://github.com/WISVCH/chue/pull/37.patch","issue_url":"https://api.github.com/repos/WISVCH/chue/issues/37","number":37,"state":"open","locked":false,"title":"Implement error handling","user":{"login":"RickWieman","id":1265791,"avatar_url":"https://avatars.githubusercontent.com/u/1265791?v=3","gravatar_id":"","url":"https://api.github.com/users/RickWieman","html_url":"https://github.com/RickWieman","followers_url":"https://api.github.com/users/RickWieman/followers","following_url":"https://api.github.com/users/RickWieman/following{/other_user}","gists_url":"https://api.github.com/users/RickWieman/gists{/gist_id}","starred_url":"https://api.github.com/users/RickWieman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RickWieman/subscriptions","organizations_url":"https://api.github.com/users/RickWieman/orgs","repos_url":"https://api.github.com/users/RickWieman/repos","events_url":"https://api.github.com/users/RickWieman/events{/privacy}","received_events_url":"https://api.github.com/users/RickWieman/received_events","type":"User","site_admin":false},"body":"As mentioned in https://github.com/WISVCH/florriebot/issues/88, chue did not yet have any error handling. For example, if the bridge is unavailable (disconnected or whatever), chue simply \"executed\" the command and replied a `200 OK` page. This PR fixes that by adding exceptions and checking whether the bridge is online. It also adds two test cases for this.","created_at":"2016-02-24T12:14:10Z","updated_at":"2016-02-24T12:18:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7297c288904fa0664b881b97a03f0c86344ba253","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WISVCH/chue/pulls/37/commits","review_comments_url":"https://api.github.com/repos/WISVCH/chue/pulls/37/comments","review_comment_url":"https://api.github.com/repos/WISVCH/chue/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WISVCH/chue/issues/37/comments","statuses_url":"https://api.github.com/repos/WISVCH/chue/statuses/f13d423ed26d7916e7b96bd468ef42b5d2baafa0","head":{"label":"WISVCH:error-handling","ref":"error-handling","sha":"f13d423ed26d7916e7b96bd468ef42b5d2baafa0","user":{"login":"WISVCH","id":1391433,"avatar_url":"https://avatars.githubusercontent.com/u/1391433?v=3","gravatar_id":"","url":"https://api.github.com/users/WISVCH","html_url":"https://github.com/WISVCH","followers_url":"https://api.github.com/users/WISVCH/followers","following_url":"https://api.github.com/users/WISVCH/following{/other_user}","gists_url":"https://api.github.com/users/WISVCH/gists{/gist_id}","starred_url":"https://api.github.com/users/WISVCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WISVCH/subscriptions","organizations_url":"https://api.github.com/users/WISVCH/orgs","repos_url":"https://api.github.com/users/WISVCH/repos","events_url":"https://api.github.com/users/WISVCH/events{/privacy}","received_events_url":"https://api.github.com/users/WISVCH/received_events","type":"Organization","site_admin":false},"repo":{"id":31262046,"name":"chue","full_name":"WISVCH/chue","owner":{"login":"WISVCH","id":1391433,"avatar_url":"https://avatars.githubusercontent.com/u/1391433?v=3","gravatar_id":"","url":"https://api.github.com/users/WISVCH","html_url":"https://github.com/WISVCH","followers_url":"https://api.github.com/users/WISVCH/followers","following_url":"https://api.github.com/users/WISVCH/following{/other_user}","gists_url":"https://api.github.com/users/WISVCH/gists{/gist_id}","starred_url":"https://api.github.com/users/WISVCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WISVCH/subscriptions","organizations_url":"https://api.github.com/users/WISVCH/orgs","repos_url":"https://api.github.com/users/WISVCH/repos","events_url":"https://api.github.com/users/WISVCH/events{/privacy}","received_events_url":"https://api.github.com/users/WISVCH/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WISVCH/chue","description":"CH Philips Hue","fork":false,"url":"https://api.github.com/repos/WISVCH/chue","forks_url":"https://api.github.com/repos/WISVCH/chue/forks","keys_url":"https://api.github.com/repos/WISVCH/chue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WISVCH/chue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WISVCH/chue/teams","hooks_url":"https://api.github.com/repos/WISVCH/chue/hooks","issue_events_url":"https://api.github.com/repos/WISVCH/chue/issues/events{/number}","events_url":"https://api.github.com/repos/WISVCH/chue/events","assignees_url":"https://api.github.com/repos/WISVCH/chue/assignees{/user}","branches_url":"https://api.github.com/repos/WISVCH/chue/branches{/branch}","tags_url":"https://api.github.com/repos/WISVCH/chue/tags","blobs_url":"https://api.github.com/repos/WISVCH/chue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WISVCH/chue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WISVCH/chue/git/refs{/sha}","trees_url":"https://api.github.com/repos/WISVCH/chue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WISVCH/chue/statuses/{sha}","languages_url":"https://api.github.com/repos/WISVCH/chue/languages","stargazers_url":"https://api.github.com/repos/WISVCH/chue/stargazers","contributors_url":"https://api.github.com/repos/WISVCH/chue/contributors","subscribers_url":"https://api.github.com/repos/WISVCH/chue/subscribers","subscription_url":"https://api.github.com/repos/WISVCH/chue/subscription","commits_url":"https://api.github.com/repos/WISVCH/chue/commits{/sha}","git_commits_url":"https://api.github.com/repos/WISVCH/chue/git/commits{/sha}","comments_url":"https://api.github.com/repos/WISVCH/chue/comments{/number}","issue_comment_url":"https://api.github.com/repos/WISVCH/chue/issues/comments{/number}","contents_url":"https://api.github.com/repos/WISVCH/chue/contents/{+path}","compare_url":"https://api.github.com/repos/WISVCH/chue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WISVCH/chue/merges","archive_url":"https://api.github.com/repos/WISVCH/chue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WISVCH/chue/downloads","issues_url":"https://api.github.com/repos/WISVCH/chue/issues{/number}","pulls_url":"https://api.github.com/repos/WISVCH/chue/pulls{/number}","milestones_url":"https://api.github.com/repos/WISVCH/chue/milestones{/number}","notifications_url":"https://api.github.com/repos/WISVCH/chue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WISVCH/chue/labels{/name}","releases_url":"https://api.github.com/repos/WISVCH/chue/releases{/id}","deployments_url":"https://api.github.com/repos/WISVCH/chue/deployments","created_at":"2015-02-24T13:48:50Z","updated_at":"2016-02-24T07:40:53Z","pushed_at":"2016-02-24T12:14:11Z","git_url":"git://github.com/WISVCH/chue.git","ssh_url":"git@github.com:WISVCH/chue.git","clone_url":"https://github.com/WISVCH/chue.git","svn_url":"https://github.com/WISVCH/chue","homepage":"https://gadgetlab.chnet/","size":541,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"WISVCH:master","ref":"master","sha":"12dcfb0cd17cb7806820214b3b15193a38795afe","user":{"login":"WISVCH","id":1391433,"avatar_url":"https://avatars.githubusercontent.com/u/1391433?v=3","gravatar_id":"","url":"https://api.github.com/users/WISVCH","html_url":"https://github.com/WISVCH","followers_url":"https://api.github.com/users/WISVCH/followers","following_url":"https://api.github.com/users/WISVCH/following{/other_user}","gists_url":"https://api.github.com/users/WISVCH/gists{/gist_id}","starred_url":"https://api.github.com/users/WISVCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WISVCH/subscriptions","organizations_url":"https://api.github.com/users/WISVCH/orgs","repos_url":"https://api.github.com/users/WISVCH/repos","events_url":"https://api.github.com/users/WISVCH/events{/privacy}","received_events_url":"https://api.github.com/users/WISVCH/received_events","type":"Organization","site_admin":false},"repo":{"id":31262046,"name":"chue","full_name":"WISVCH/chue","owner":{"login":"WISVCH","id":1391433,"avatar_url":"https://avatars.githubusercontent.com/u/1391433?v=3","gravatar_id":"","url":"https://api.github.com/users/WISVCH","html_url":"https://github.com/WISVCH","followers_url":"https://api.github.com/users/WISVCH/followers","following_url":"https://api.github.com/users/WISVCH/following{/other_user}","gists_url":"https://api.github.com/users/WISVCH/gists{/gist_id}","starred_url":"https://api.github.com/users/WISVCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WISVCH/subscriptions","organizations_url":"https://api.github.com/users/WISVCH/orgs","repos_url":"https://api.github.com/users/WISVCH/repos","events_url":"https://api.github.com/users/WISVCH/events{/privacy}","received_events_url":"https://api.github.com/users/WISVCH/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WISVCH/chue","description":"CH Philips Hue","fork":false,"url":"https://api.github.com/repos/WISVCH/chue","forks_url":"https://api.github.com/repos/WISVCH/chue/forks","keys_url":"https://api.github.com/repos/WISVCH/chue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WISVCH/chue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WISVCH/chue/teams","hooks_url":"https://api.github.com/repos/WISVCH/chue/hooks","issue_events_url":"https://api.github.com/repos/WISVCH/chue/issues/events{/number}","events_url":"https://api.github.com/repos/WISVCH/chue/events","assignees_url":"https://api.github.com/repos/WISVCH/chue/assignees{/user}","branches_url":"https://api.github.com/repos/WISVCH/chue/branches{/branch}","tags_url":"https://api.github.com/repos/WISVCH/chue/tags","blobs_url":"https://api.github.com/repos/WISVCH/chue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WISVCH/chue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WISVCH/chue/git/refs{/sha}","trees_url":"https://api.github.com/repos/WISVCH/chue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WISVCH/chue/statuses/{sha}","languages_url":"https://api.github.com/repos/WISVCH/chue/languages","stargazers_url":"https://api.github.com/repos/WISVCH/chue/stargazers","contributors_url":"https://api.github.com/repos/WISVCH/chue/contributors","subscribers_url":"https://api.github.com/repos/WISVCH/chue/subscribers","subscription_url":"https://api.github.com/repos/WISVCH/chue/subscription","commits_url":"https://api.github.com/repos/WISVCH/chue/commits{/sha}","git_commits_url":"https://api.github.com/repos/WISVCH/chue/git/commits{/sha}","comments_url":"https://api.github.com/repos/WISVCH/chue/comments{/number}","issue_comment_url":"https://api.github.com/repos/WISVCH/chue/issues/comments{/number}","contents_url":"https://api.github.com/repos/WISVCH/chue/contents/{+path}","compare_url":"https://api.github.com/repos/WISVCH/chue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WISVCH/chue/merges","archive_url":"https://api.github.com/repos/WISVCH/chue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WISVCH/chue/downloads","issues_url":"https://api.github.com/repos/WISVCH/chue/issues{/number}","pulls_url":"https://api.github.com/repos/WISVCH/chue/pulls{/number}","milestones_url":"https://api.github.com/repos/WISVCH/chue/milestones{/number}","notifications_url":"https://api.github.com/repos/WISVCH/chue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WISVCH/chue/labels{/name}","releases_url":"https://api.github.com/repos/WISVCH/chue/releases{/id}","deployments_url":"https://api.github.com/repos/WISVCH/chue/deployments","created_at":"2015-02-24T13:48:50Z","updated_at":"2016-02-24T07:40:53Z","pushed_at":"2016-02-24T12:14:11Z","git_url":"git://github.com/WISVCH/chue.git","ssh_url":"git@github.com:WISVCH/chue.git","clone_url":"https://github.com/WISVCH/chue.git","svn_url":"https://github.com/WISVCH/chue","homepage":"https://gadgetlab.chnet/","size":541,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WISVCH/chue/pulls/37"},"html":{"href":"https://github.com/WISVCH/chue/pull/37"},"issue":{"href":"https://api.github.com/repos/WISVCH/chue/issues/37"},"comments":{"href":"https://api.github.com/repos/WISVCH/chue/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/WISVCH/chue/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/WISVCH/chue/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WISVCH/chue/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/WISVCH/chue/statuses/f13d423ed26d7916e7b96bd468ef42b5d2baafa0"}}}}