{"action":"created","comment":{"url":"https://api.github.com/repos/w3c/sensors/pulls/comments/167229314","pull_request_review_id":95421975,"id":167229314,"diff_hunk":"@@ -249,20 +252,36 @@ and defensive programming which includes:\n     enhanced by the possible usage of a sensor, not degraded by its\n     absence.\n \n-<div class=\"example\">\n+<div class=\"example\" id=\"robust-example\">\n+    The following snippet illustrates how an Accelerometer sensor can be created\n+    in a robust manner.\n     <pre highlight=\"js\">\n-        try { // No need to feature detect thanks to try..catch block.\n-            var sensor = new GeolocationSensor();\n-            sensor.start();\n-            sensor.onerror = error => gracefullyDegrade(error);\n-            sensor.onreading = _ => updatePosition(sensor.latitude, sensor.longitude);\n-        } catch(error) {\n-            gracefullyDegrade(error);\n+        let accelerometer = null;\n+        try {\n+            accelerometer = new Accelerometer({ frequency: 10 });\n+            accelerometer.addEventListener('error', event => handleErrors(event.error));","path":"index.bs","position":29,"original_position":29,"commit_id":"bdae54bd1b5d7eb786ed2cdd1e593a434074f6ac","original_commit_id":"bdae54bd1b5d7eb786ed2cdd1e593a434074f6ac","user":{"login":"kenchris","id":1101339,"avatar_url":"https://avatars1.githubusercontent.com/u/1101339?v=4","gravatar_id":"","url":"https://api.github.com/users/kenchris","html_url":"https://github.com/kenchris","followers_url":"https://api.github.com/users/kenchris/followers","following_url":"https://api.github.com/users/kenchris/following{/other_user}","gists_url":"https://api.github.com/users/kenchris/gists{/gist_id}","starred_url":"https://api.github.com/users/kenchris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenchris/subscriptions","organizations_url":"https://api.github.com/users/kenchris/orgs","repos_url":"https://api.github.com/users/kenchris/repos","events_url":"https://api.github.com/users/kenchris/events{/privacy}","received_events_url":"https://api.github.com/users/kenchris/received_events","type":"User","site_admin":false},"body":"Then the throw makes even less sense... why not print to console straight away in both cases, you could use console.error()","created_at":"2018-02-09T13:40:59Z","updated_at":"2018-02-09T13:40:59Z","html_url":"https://github.com/w3c/sensors/pull/341#discussion_r167229314","pull_request_url":"https://api.github.com/repos/w3c/sensors/pulls/341","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/w3c/sensors/pulls/comments/167229314"},"html":{"href":"https://github.com/w3c/sensors/pull/341#discussion_r167229314"},"pull_request":{"href":"https://api.github.com/repos/w3c/sensors/pulls/341"}},"in_reply_to_id":167226239},"pull_request":{"url":"https://api.github.com/repos/w3c/sensors/pulls/341","id":168230950,"html_url":"https://github.com/w3c/sensors/pull/341","diff_url":"https://github.com/w3c/sensors/pull/341.diff","patch_url":"https://github.com/w3c/sensors/pull/341.patch","issue_url":"https://api.github.com/repos/w3c/sensors/issues/341","number":341,"state":"open","locked":false,"title":"Update feature detection example","user":{"login":"alexshalamov","id":1001009,"avatar_url":"https://avatars0.githubusercontent.com/u/1001009?v=4","gravatar_id":"","url":"https://api.github.com/users/alexshalamov","html_url":"https://github.com/alexshalamov","followers_url":"https://api.github.com/users/alexshalamov/followers","following_url":"https://api.github.com/users/alexshalamov/following{/other_user}","gists_url":"https://api.github.com/users/alexshalamov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexshalamov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexshalamov/subscriptions","organizations_url":"https://api.github.com/users/alexshalamov/orgs","repos_url":"https://api.github.com/users/alexshalamov/repos","events_url":"https://api.github.com/users/alexshalamov/events{/privacy}","received_events_url":"https://api.github.com/users/alexshalamov/received_events","type":"User","site_admin":false},"body":"Fixes: #339\n\n\n<!--\n    This comment and the below content is programatically generated.\n    You may add a comma-separated list of anchors you'd like a\n    direct link to below (e.g. #idl-serializers, #idl-sequence):\n\n    Don't remove this comment or modify anything below this line.\n    If you don't want a preview generated for this pull request,\n    just replace the whole of this comment's content by \"no preview\"\n    and remove what's below.\n-->\n***\n<a href=\"https://pr-preview.s3.amazonaws.com/alexshalamov/sensors/pull/341.html\" title=\"Last updated on Feb 9, 2018, 12:47 PM GMT (bdae54b)\">Preview</a> | <a href=\"https://pr-preview.s3.amazonaws.com/w3c/sensors/341/788d323...alexshalamov:bdae54b.html\" title=\"Last updated on Feb 9, 2018, 12:47 PM GMT (bdae54b)\">Diff</a>","created_at":"2018-02-09T12:47:03Z","updated_at":"2018-02-09T13:40:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9b1f3cd139667da3cce955e6d4aee25ea76ff19","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rwaldron","id":27985,"avatar_url":"https://avatars3.githubusercontent.com/u/27985?v=4","gravatar_id":"","url":"https://api.github.com/users/rwaldron","html_url":"https://github.com/rwaldron","followers_url":"https://api.github.com/users/rwaldron/followers","following_url":"https://api.github.com/users/rwaldron/following{/other_user}","gists_url":"https://api.github.com/users/rwaldron/gists{/gist_id}","starred_url":"https://api.github.com/users/rwaldron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwaldron/subscriptions","organizations_url":"https://api.github.com/users/rwaldron/orgs","repos_url":"https://api.github.com/users/rwaldron/repos","events_url":"https://api.github.com/users/rwaldron/events{/privacy}","received_events_url":"https://api.github.com/users/rwaldron/received_events","type":"User","site_admin":false},{"login":"pozdnyakov","id":998253,"avatar_url":"https://avatars1.githubusercontent.com/u/998253?v=4","gravatar_id":"","url":"https://api.github.com/users/pozdnyakov","html_url":"https://github.com/pozdnyakov","followers_url":"https://api.github.com/users/pozdnyakov/followers","following_url":"https://api.github.com/users/pozdnyakov/following{/other_user}","gists_url":"https://api.github.com/users/pozdnyakov/gists{/gist_id}","starred_url":"https://api.github.com/users/pozdnyakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pozdnyakov/subscriptions","organizations_url":"https://api.github.com/users/pozdnyakov/orgs","repos_url":"https://api.github.com/users/pozdnyakov/repos","events_url":"https://api.github.com/users/pozdnyakov/events{/privacy}","received_events_url":"https://api.github.com/users/pozdnyakov/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/w3c/sensors/pulls/341/commits","review_comments_url":"https://api.github.com/repos/w3c/sensors/pulls/341/comments","review_comment_url":"https://api.github.com/repos/w3c/sensors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/w3c/sensors/issues/341/comments","statuses_url":"https://api.github.com/repos/w3c/sensors/statuses/bdae54bd1b5d7eb786ed2cdd1e593a434074f6ac","head":{"label":"alexshalamov:improve_feature_detection","ref":"improve_feature_detection","sha":"bdae54bd1b5d7eb786ed2cdd1e593a434074f6ac","user":{"login":"alexshalamov","id":1001009,"avatar_url":"https://avatars0.githubusercontent.com/u/1001009?v=4","gravatar_id":"","url":"https://api.github.com/users/alexshalamov","html_url":"https://github.com/alexshalamov","followers_url":"https://api.github.com/users/alexshalamov/followers","following_url":"https://api.github.com/users/alexshalamov/following{/other_user}","gists_url":"https://api.github.com/users/alexshalamov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexshalamov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexshalamov/subscriptions","organizations_url":"https://api.github.com/users/alexshalamov/orgs","repos_url":"https://api.github.com/users/alexshalamov/repos","events_url":"https://api.github.com/users/alexshalamov/events{/privacy}","received_events_url":"https://api.github.com/users/alexshalamov/received_events","type":"User","site_admin":false},"repo":{"id":91795062,"name":"sensors","full_name":"alexshalamov/sensors","owner":{"login":"alexshalamov","id":1001009,"avatar_url":"https://avatars0.githubusercontent.com/u/1001009?v=4","gravatar_id":"","url":"https://api.github.com/users/alexshalamov","html_url":"https://github.com/alexshalamov","followers_url":"https://api.github.com/users/alexshalamov/followers","following_url":"https://api.github.com/users/alexshalamov/following{/other_user}","gists_url":"https://api.github.com/users/alexshalamov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexshalamov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexshalamov/subscriptions","organizations_url":"https://api.github.com/users/alexshalamov/orgs","repos_url":"https://api.github.com/users/alexshalamov/repos","events_url":"https://api.github.com/users/alexshalamov/events{/privacy}","received_events_url":"https://api.github.com/users/alexshalamov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexshalamov/sensors","description":"Generic Sensor API","fork":true,"url":"https://api.github.com/repos/alexshalamov/sensors","forks_url":"https://api.github.com/repos/alexshalamov/sensors/forks","keys_url":"https://api.github.com/repos/alexshalamov/sensors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexshalamov/sensors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexshalamov/sensors/teams","hooks_url":"https://api.github.com/repos/alexshalamov/sensors/hooks","issue_events_url":"https://api.github.com/repos/alexshalamov/sensors/issues/events{/number}","events_url":"https://api.github.com/repos/alexshalamov/sensors/events","assignees_url":"https://api.github.com/repos/alexshalamov/sensors/assignees{/user}","branches_url":"https://api.github.com/repos/alexshalamov/sensors/branches{/branch}","tags_url":"https://api.github.com/repos/alexshalamov/sensors/tags","blobs_url":"https://api.github.com/repos/alexshalamov/sensors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexshalamov/sensors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexshalamov/sensors/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexshalamov/sensors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexshalamov/sensors/statuses/{sha}","languages_url":"https://api.github.com/repos/alexshalamov/sensors/languages","stargazers_url":"https://api.github.com/repos/alexshalamov/sensors/stargazers","contributors_url":"https://api.github.com/repos/alexshalamov/sensors/contributors","subscribers_url":"https://api.github.com/repos/alexshalamov/sensors/subscribers","subscription_url":"https://api.github.com/repos/alexshalamov/sensors/subscription","commits_url":"https://api.github.com/repos/alexshalamov/sensors/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexshalamov/sensors/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexshalamov/sensors/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexshalamov/sensors/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexshalamov/sensors/contents/{+path}","compare_url":"https://api.github.com/repos/alexshalamov/sensors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexshalamov/sensors/merges","archive_url":"https://api.github.com/repos/alexshalamov/sensors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexshalamov/sensors/downloads","issues_url":"https://api.github.com/repos/alexshalamov/sensors/issues{/number}","pulls_url":"https://api.github.com/repos/alexshalamov/sensors/pulls{/number}","milestones_url":"https://api.github.com/repos/alexshalamov/sensors/milestones{/number}","notifications_url":"https://api.github.com/repos/alexshalamov/sensors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexshalamov/sensors/labels{/name}","releases_url":"https://api.github.com/repos/alexshalamov/sensors/releases{/id}","deployments_url":"https://api.github.com/repos/alexshalamov/sensors/deployments","created_at":"2017-05-19T10:28:00Z","updated_at":"2017-05-19T10:28:01Z","pushed_at":"2018-02-09T12:46:25Z","git_url":"git://github.com/alexshalamov/sensors.git","ssh_url":"git@github.com:alexshalamov/sensors.git","clone_url":"https://github.com/alexshalamov/sensors.git","svn_url":"https://github.com/alexshalamov/sensors","homepage":"https://w3c.github.io/sensors/","size":1661,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"w3c:master","ref":"master","sha":"788d323b6364fbf8ca0f574c1c0713b2ef2a1912","user":{"login":"w3c","id":379216,"avatar_url":"https://avatars2.githubusercontent.com/u/379216?v=4","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"repo":{"id":26634225,"name":"sensors","full_name":"w3c/sensors","owner":{"login":"w3c","id":379216,"avatar_url":"https://avatars2.githubusercontent.com/u/379216?v=4","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/w3c/sensors","description":"Generic Sensor API","fork":false,"url":"https://api.github.com/repos/w3c/sensors","forks_url":"https://api.github.com/repos/w3c/sensors/forks","keys_url":"https://api.github.com/repos/w3c/sensors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/sensors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/sensors/teams","hooks_url":"https://api.github.com/repos/w3c/sensors/hooks","issue_events_url":"https://api.github.com/repos/w3c/sensors/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/sensors/events","assignees_url":"https://api.github.com/repos/w3c/sensors/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/sensors/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/sensors/tags","blobs_url":"https://api.github.com/repos/w3c/sensors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/sensors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/sensors/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/sensors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/sensors/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/sensors/languages","stargazers_url":"https://api.github.com/repos/w3c/sensors/stargazers","contributors_url":"https://api.github.com/repos/w3c/sensors/contributors","subscribers_url":"https://api.github.com/repos/w3c/sensors/subscribers","subscription_url":"https://api.github.com/repos/w3c/sensors/subscription","commits_url":"https://api.github.com/repos/w3c/sensors/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/sensors/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/sensors/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/sensors/issues/comments{/number}","contents_url":"https://api.github.com/repos/w3c/sensors/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/sensors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/sensors/merges","archive_url":"https://api.github.com/repos/w3c/sensors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/sensors/downloads","issues_url":"https://api.github.com/repos/w3c/sensors/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/sensors/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/sensors/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/sensors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/sensors/labels{/name}","releases_url":"https://api.github.com/repos/w3c/sensors/releases{/id}","deployments_url":"https://api.github.com/repos/w3c/sensors/deployments","created_at":"2014-11-14T10:42:31Z","updated_at":"2018-02-06T01:55:28Z","pushed_at":"2018-02-09T12:47:04Z","git_url":"git://github.com/w3c/sensors.git","ssh_url":"git@github.com:w3c/sensors.git","clone_url":"https://github.com/w3c/sensors.git","svn_url":"https://github.com/w3c/sensors","homepage":"https://w3c.github.io/sensors/","size":1491,"stargazers_count":100,"watchers_count":100,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":37,"mirror_url":null,"archived":false,"open_issues_count":40,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":37,"open_issues":40,"watchers":100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/w3c/sensors/pulls/341"},"html":{"href":"https://github.com/w3c/sensors/pull/341"},"issue":{"href":"https://api.github.com/repos/w3c/sensors/issues/341"},"comments":{"href":"https://api.github.com/repos/w3c/sensors/issues/341/comments"},"review_comments":{"href":"https://api.github.com/repos/w3c/sensors/pulls/341/comments"},"review_comment":{"href":"https://api.github.com/repos/w3c/sensors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/w3c/sensors/pulls/341/commits"},"statuses":{"href":"https://api.github.com/repos/w3c/sensors/statuses/bdae54bd1b5d7eb786ed2cdd1e593a434074f6ac"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"kenchris"}}