{"action":"created","comment":{"url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/comments/34498665","id":34498665,"diff_hunk":"@@ -0,0 +1,72 @@\n+<h1>An Exceptional Future</h1>\n+<table class=\"table meta-table table-condensed\">\n+  <tbody>\n+    <tr>\n+      <td class=\"header-column\"><strong>Contributed by</strong></td>\n+      <td>Andy Wortman</td>\n+    </tr>\n+    <tr>\n+      <td><strong>Source</strong></td>\n+      <td>N/A</td>\n+    </tr>\n+    <tr>\n+      <td><strong>First tested with Scala version</strong></td>\n+      <td>2.11.4</td>\n+    </tr>\n+  </tbody>\n+</table>\n+<div class=\"code-snippet\">\n+  <h3>What is the result of executing the following code?</h3>\n+<pre class=\"prettyprint lang-scala\">\n+import scala.concurrent.Future\n+import scala.concurrent.ExecutionContext.Implicits.global\n+import scala.util.{Failure, Success}\n+\n+val f = Future { throw new Error(\"fatal!\") } recoverWith {\n+  case err: Error => Future.successful(\"Ignoring error: \" + err.getMessage)\n+}\n+f onComplete {\n+  case Success(res) => println(\"Yay: \" + res)\n+  case Failure(e) => println(\"Oops: \" + e.getMessage)\n+}\n+</pre>\n+  <ol>\n+    <li>Prints:\n+<pre class=\"prettyprint lang-scala\">\n+Yay: Ignoring error: fatal!\n+</pre>\n+    </li>\n+    <li>Throws an error</li>\n+    <li>Prints:\n+<pre class=\"prettyprint lang-scala\">\n+Oops: fatal!\n+</pre>\n+    </li>\n+    <li id=\"correct-answer\">Prints:\n+<pre class=\"prettyprint lang-scala\">\n+Oops: Boxed Error\n+</pre>\n+    </li>\n+  </ol>\n+</div>\n+<button id=\"show-and-tell\" class=\"btn btn-primary\" href=\"#\">Display the correct answer, explanation and comments</button>\n+<div id=\"explanation\" class=\"explanation\" style=\"display:none\">\n+  <h3>Explanation</h3>\n+  <p>\n+    As described inthe documetation for Futures and Promises</a>","path":"puzzlers/pzzlr-future-error-puzzler.html","position":56,"original_position":56,"commit_id":"714da36031778f541dfb51c991b5317a1c04dbf9","original_commit_id":"714da36031778f541dfb51c991b5317a1c04dbf9","user":{"login":"demobox","id":223702,"avatar_url":"https://avatars.githubusercontent.com/u/223702?v=3","gravatar_id":"","url":"https://api.github.com/users/demobox","html_url":"https://github.com/demobox","followers_url":"https://api.github.com/users/demobox/followers","following_url":"https://api.github.com/users/demobox/following{/other_user}","gists_url":"https://api.github.com/users/demobox/gists{/gist_id}","starred_url":"https://api.github.com/users/demobox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demobox/subscriptions","organizations_url":"https://api.github.com/users/demobox/orgs","repos_url":"https://api.github.com/users/demobox/repos","events_url":"https://api.github.com/users/demobox/events{/privacy}","received_events_url":"https://api.github.com/users/demobox/received_events","type":"User","site_admin":false},"body":"Good catch, thanks! Actually, the whole sentence is just a leftover from editing.","created_at":"2015-07-13T19:00:07Z","updated_at":"2015-07-13T19:00:07Z","html_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com/pull/129#discussion_r34498665","pull_request_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/129","_links":{"self":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/comments/34498665"},"html":{"href":"https://github.com/scalapuzzlers/scalapuzzlers.github.com/pull/129#discussion_r34498665"},"pull_request":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/129"}}},"pull_request":{"url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/129","id":39805351,"html_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com/pull/129","diff_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com/pull/129.diff","patch_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com/pull/129.patch","issue_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues/129","number":129,"state":"open","locked":false,"title":"Puzzler about throwing an Error in a Future","user":{"login":"demobox","id":223702,"avatar_url":"https://avatars.githubusercontent.com/u/223702?v=3","gravatar_id":"","url":"https://api.github.com/users/demobox","html_url":"https://github.com/demobox","followers_url":"https://api.github.com/users/demobox/followers","following_url":"https://api.github.com/users/demobox/following{/other_user}","gists_url":"https://api.github.com/users/demobox/gists{/gist_id}","starred_url":"https://api.github.com/users/demobox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demobox/subscriptions","organizations_url":"https://api.github.com/users/demobox/orgs","repos_url":"https://api.github.com/users/demobox/repos","events_url":"https://api.github.com/users/demobox/events{/privacy}","received_events_url":"https://api.github.com/users/demobox/received_events","type":"User","site_admin":false},"body":"Continuation of #128. @a-wortman: I want back and forth over what to put in the `recoverWith` clause but I think having the `Error` in there leads to the most confusion: you're seemingly recovering from precisely the type of throwable that's thrown, yet you still get a failure.","created_at":"2015-07-13T12:16:03Z","updated_at":"2015-07-13T19:00:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"401d6fd81a28090b3b84dff324b8b4bb41edcbcb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/129/commits","review_comments_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/129/comments","review_comment_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues/129/comments","statuses_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/statuses/714da36031778f541dfb51c991b5317a1c04dbf9","head":{"label":"scalapuzzlers:future-error-puzzler","ref":"future-error-puzzler","sha":"714da36031778f541dfb51c991b5317a1c04dbf9","user":{"login":"scalapuzzlers","id":1646212,"avatar_url":"https://avatars.githubusercontent.com/u/1646212?v=3","gravatar_id":"","url":"https://api.github.com/users/scalapuzzlers","html_url":"https://github.com/scalapuzzlers","followers_url":"https://api.github.com/users/scalapuzzlers/followers","following_url":"https://api.github.com/users/scalapuzzlers/following{/other_user}","gists_url":"https://api.github.com/users/scalapuzzlers/gists{/gist_id}","starred_url":"https://api.github.com/users/scalapuzzlers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalapuzzlers/subscriptions","organizations_url":"https://api.github.com/users/scalapuzzlers/orgs","repos_url":"https://api.github.com/users/scalapuzzlers/repos","events_url":"https://api.github.com/users/scalapuzzlers/events{/privacy}","received_events_url":"https://api.github.com/users/scalapuzzlers/received_events","type":"User","site_admin":false},"repo":{"id":4171542,"name":"scalapuzzlers.github.com","full_name":"scalapuzzlers/scalapuzzlers.github.com","owner":{"login":"scalapuzzlers","id":1646212,"avatar_url":"https://avatars.githubusercontent.com/u/1646212?v=3","gravatar_id":"","url":"https://api.github.com/users/scalapuzzlers","html_url":"https://github.com/scalapuzzlers","followers_url":"https://api.github.com/users/scalapuzzlers/followers","following_url":"https://api.github.com/users/scalapuzzlers/following{/other_user}","gists_url":"https://api.github.com/users/scalapuzzlers/gists{/gist_id}","starred_url":"https://api.github.com/users/scalapuzzlers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalapuzzlers/subscriptions","organizations_url":"https://api.github.com/users/scalapuzzlers/orgs","repos_url":"https://api.github.com/users/scalapuzzlers/repos","events_url":"https://api.github.com/users/scalapuzzlers/events{/privacy}","received_events_url":"https://api.github.com/users/scalapuzzlers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com","description":"Github Pages behind scalapuzzlers.com","fork":false,"url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com","forks_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/forks","keys_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/teams","hooks_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/hooks","issue_events_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues/events{/number}","events_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/events","assignees_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/assignees{/user}","branches_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/branches{/branch}","tags_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/tags","blobs_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/statuses/{sha}","languages_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/languages","stargazers_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/stargazers","contributors_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/contributors","subscribers_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/subscribers","subscription_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/subscription","commits_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/contents/{+path}","compare_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/merges","archive_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/downloads","issues_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues{/number}","pulls_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls{/number}","milestones_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/milestones{/number}","notifications_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/labels{/name}","releases_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/releases{/id}","created_at":"2012-04-29T01:12:13Z","updated_at":"2015-06-21T04:50:55Z","pushed_at":"2015-07-13T12:16:03Z","git_url":"git://github.com/scalapuzzlers/scalapuzzlers.github.com.git","ssh_url":"git@github.com:scalapuzzlers/scalapuzzlers.github.com.git","clone_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com.git","svn_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com","homepage":"www.scalapuzzlers.com","size":1981,"stargazers_count":90,"watchers_count":90,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":32,"mirror_url":null,"open_issues_count":11,"forks":32,"open_issues":11,"watchers":90,"default_branch":"master"}},"base":{"label":"scalapuzzlers:master","ref":"master","sha":"ca32f51bbc4c8d2a70dffcf3e13f1578a9ae091c","user":{"login":"scalapuzzlers","id":1646212,"avatar_url":"https://avatars.githubusercontent.com/u/1646212?v=3","gravatar_id":"","url":"https://api.github.com/users/scalapuzzlers","html_url":"https://github.com/scalapuzzlers","followers_url":"https://api.github.com/users/scalapuzzlers/followers","following_url":"https://api.github.com/users/scalapuzzlers/following{/other_user}","gists_url":"https://api.github.com/users/scalapuzzlers/gists{/gist_id}","starred_url":"https://api.github.com/users/scalapuzzlers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalapuzzlers/subscriptions","organizations_url":"https://api.github.com/users/scalapuzzlers/orgs","repos_url":"https://api.github.com/users/scalapuzzlers/repos","events_url":"https://api.github.com/users/scalapuzzlers/events{/privacy}","received_events_url":"https://api.github.com/users/scalapuzzlers/received_events","type":"User","site_admin":false},"repo":{"id":4171542,"name":"scalapuzzlers.github.com","full_name":"scalapuzzlers/scalapuzzlers.github.com","owner":{"login":"scalapuzzlers","id":1646212,"avatar_url":"https://avatars.githubusercontent.com/u/1646212?v=3","gravatar_id":"","url":"https://api.github.com/users/scalapuzzlers","html_url":"https://github.com/scalapuzzlers","followers_url":"https://api.github.com/users/scalapuzzlers/followers","following_url":"https://api.github.com/users/scalapuzzlers/following{/other_user}","gists_url":"https://api.github.com/users/scalapuzzlers/gists{/gist_id}","starred_url":"https://api.github.com/users/scalapuzzlers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalapuzzlers/subscriptions","organizations_url":"https://api.github.com/users/scalapuzzlers/orgs","repos_url":"https://api.github.com/users/scalapuzzlers/repos","events_url":"https://api.github.com/users/scalapuzzlers/events{/privacy}","received_events_url":"https://api.github.com/users/scalapuzzlers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com","description":"Github Pages behind scalapuzzlers.com","fork":false,"url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com","forks_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/forks","keys_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/teams","hooks_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/hooks","issue_events_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues/events{/number}","events_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/events","assignees_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/assignees{/user}","branches_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/branches{/branch}","tags_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/tags","blobs_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/statuses/{sha}","languages_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/languages","stargazers_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/stargazers","contributors_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/contributors","subscribers_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/subscribers","subscription_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/subscription","commits_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/contents/{+path}","compare_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/merges","archive_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/downloads","issues_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues{/number}","pulls_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls{/number}","milestones_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/milestones{/number}","notifications_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/labels{/name}","releases_url":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/releases{/id}","created_at":"2012-04-29T01:12:13Z","updated_at":"2015-06-21T04:50:55Z","pushed_at":"2015-07-13T12:16:03Z","git_url":"git://github.com/scalapuzzlers/scalapuzzlers.github.com.git","ssh_url":"git@github.com:scalapuzzlers/scalapuzzlers.github.com.git","clone_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com.git","svn_url":"https://github.com/scalapuzzlers/scalapuzzlers.github.com","homepage":"www.scalapuzzlers.com","size":1981,"stargazers_count":90,"watchers_count":90,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":32,"mirror_url":null,"open_issues_count":11,"forks":32,"open_issues":11,"watchers":90,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/129"},"html":{"href":"https://github.com/scalapuzzlers/scalapuzzlers.github.com/pull/129"},"issue":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues/129"},"comments":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/issues/129/comments"},"review_comments":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/129/comments"},"review_comment":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/pulls/129/commits"},"statuses":{"href":"https://api.github.com/repos/scalapuzzlers/scalapuzzlers.github.com/statuses/714da36031778f541dfb51c991b5317a1c04dbf9"}}}}