{"action":"created","comment":{"url":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/comments/41088208","id":41088208,"diff_hunk":"@@ -153,16 +137,49 @@ object DB {\n   } yield res\n \n   /**\n+   * ADT for errors that might happen in working with our grammar.\n+   */\n+  sealed abstract class DBError {\n+    def message: String\n+  }\n+  /**\n+   * If no value was found at the requested key.\n+   */\n+  case class ValueNotFound(key: Key) extends DBError {\n+    def message: String = s\"No value found for key '$key'.\"\n+  }\n+  /**\n+   * If a value already exists at key.\n+   */\n+  case class ValueExists(key: Key) extends DBError {\n+    def message: String = s\"Value for '$key' already exists.\"\n+  }\n+  /**\n+   * If the hash for an update doesn't match.\n+   */\n+  case class HashMismatch(key: Key) extends DBError {\n+    def message: String = s\"The hash for '$key' was incorrect.\"\n+  }\n+  /**\n+   * All other errors will be exceptions that come out of the underlying store. They'll be\n+   * wrapped up in this type.\n+   */\n+  case class GeneralError(ex: Throwable) extends DBError {","path":"src/main/scala/com/ironcorelabs/davenport/DB.scala","position":100,"original_position":100,"commit_id":"1cf23f271df6886f8fcf69fd30ba23563de7e3a2","original_commit_id":"1cf23f271df6886f8fcf69fd30ba23563de7e3a2","user":{"login":"zmre","id":71791,"avatar_url":"https://avatars.githubusercontent.com/u/71791?v=3","gravatar_id":"","url":"https://api.github.com/users/zmre","html_url":"https://github.com/zmre","followers_url":"https://api.github.com/users/zmre/followers","following_url":"https://api.github.com/users/zmre/following{/other_user}","gists_url":"https://api.github.com/users/zmre/gists{/gist_id}","starred_url":"https://api.github.com/users/zmre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmre/subscriptions","organizations_url":"https://api.github.com/users/zmre/orgs","repos_url":"https://api.github.com/users/zmre/repos","events_url":"https://api.github.com/users/zmre/events{/privacy}","received_events_url":"https://api.github.com/users/zmre/received_events","type":"User","site_admin":false},"body":"Is this a cop out?  Seems like you've solidified 3 errors and then just made a Throwable wrapper for all the rest.  Is the idea to eventually do away with this one?  Or will this always be used as a catch-all?  Also, is this a standard way to model error ADTs?  With a `GeneralError` wrapping an exception?\r\n\r\nOn the positive side, I'm glad we're not ignoring the original exception and we're capturing it so we can figure out the details of the issue.","created_at":"2015-10-03T15:35:42Z","updated_at":"2015-10-03T15:35:42Z","html_url":"https://github.com/IronCoreLabs/davenport/pull/21#discussion_r41088208","pull_request_url":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/comments/41088208"},"html":{"href":"https://github.com/IronCoreLabs/davenport/pull/21#discussion_r41088208"},"pull_request":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/21","id":46698748,"html_url":"https://github.com/IronCoreLabs/davenport/pull/21","diff_url":"https://github.com/IronCoreLabs/davenport/pull/21.diff","patch_url":"https://github.com/IronCoreLabs/davenport/pull/21.patch","issue_url":"https://api.github.com/repos/IronCoreLabs/davenport/issues/21","number":21,"state":"open","locked":false,"title":"Move from Throwable to an error ADT.","user":{"login":"coltfred","id":587319,"avatar_url":"https://avatars.githubusercontent.com/u/587319?v=3","gravatar_id":"","url":"https://api.github.com/users/coltfred","html_url":"https://github.com/coltfred","followers_url":"https://api.github.com/users/coltfred/followers","following_url":"https://api.github.com/users/coltfred/following{/other_user}","gists_url":"https://api.github.com/users/coltfred/gists{/gist_id}","starred_url":"https://api.github.com/users/coltfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coltfred/subscriptions","organizations_url":"https://api.github.com/users/coltfred/orgs","repos_url":"https://api.github.com/users/coltfred/repos","events_url":"https://api.github.com/users/coltfred/events{/privacy}","received_events_url":"https://api.github.com/users/coltfred/received_events","type":"User","site_admin":false},"body":"An initial idea for an ADT for the grammar. I don't think it's complete, but I do think it's roughly the right direction. Addresses #19.","created_at":"2015-10-03T03:17:53Z","updated_at":"2015-10-03T15:35:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71e6dfc83c7f1f18659228bd754ed2809780bb81","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/21/commits","review_comments_url":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/21/comments","review_comment_url":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IronCoreLabs/davenport/issues/21/comments","statuses_url":"https://api.github.com/repos/IronCoreLabs/davenport/statuses/1cf23f271df6886f8fcf69fd30ba23563de7e3a2","head":{"label":"coltfred:errorADT","ref":"errorADT","sha":"1cf23f271df6886f8fcf69fd30ba23563de7e3a2","user":{"login":"coltfred","id":587319,"avatar_url":"https://avatars.githubusercontent.com/u/587319?v=3","gravatar_id":"","url":"https://api.github.com/users/coltfred","html_url":"https://github.com/coltfred","followers_url":"https://api.github.com/users/coltfred/followers","following_url":"https://api.github.com/users/coltfred/following{/other_user}","gists_url":"https://api.github.com/users/coltfred/gists{/gist_id}","starred_url":"https://api.github.com/users/coltfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coltfred/subscriptions","organizations_url":"https://api.github.com/users/coltfred/orgs","repos_url":"https://api.github.com/users/coltfred/repos","events_url":"https://api.github.com/users/coltfred/events{/privacy}","received_events_url":"https://api.github.com/users/coltfred/received_events","type":"User","site_admin":false},"repo":{"id":41130509,"name":"davenport","full_name":"coltfred/davenport","owner":{"login":"coltfred","id":587319,"avatar_url":"https://avatars.githubusercontent.com/u/587319?v=3","gravatar_id":"","url":"https://api.github.com/users/coltfred","html_url":"https://github.com/coltfred","followers_url":"https://api.github.com/users/coltfred/followers","following_url":"https://api.github.com/users/coltfred/following{/other_user}","gists_url":"https://api.github.com/users/coltfred/gists{/gist_id}","starred_url":"https://api.github.com/users/coltfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coltfred/subscriptions","organizations_url":"https://api.github.com/users/coltfred/orgs","repos_url":"https://api.github.com/users/coltfred/repos","events_url":"https://api.github.com/users/coltfred/events{/privacy}","received_events_url":"https://api.github.com/users/coltfred/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coltfred/davenport","description":"A principled CouchBase library for Scala","fork":true,"url":"https://api.github.com/repos/coltfred/davenport","forks_url":"https://api.github.com/repos/coltfred/davenport/forks","keys_url":"https://api.github.com/repos/coltfred/davenport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coltfred/davenport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coltfred/davenport/teams","hooks_url":"https://api.github.com/repos/coltfred/davenport/hooks","issue_events_url":"https://api.github.com/repos/coltfred/davenport/issues/events{/number}","events_url":"https://api.github.com/repos/coltfred/davenport/events","assignees_url":"https://api.github.com/repos/coltfred/davenport/assignees{/user}","branches_url":"https://api.github.com/repos/coltfred/davenport/branches{/branch}","tags_url":"https://api.github.com/repos/coltfred/davenport/tags","blobs_url":"https://api.github.com/repos/coltfred/davenport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coltfred/davenport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coltfred/davenport/git/refs{/sha}","trees_url":"https://api.github.com/repos/coltfred/davenport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coltfred/davenport/statuses/{sha}","languages_url":"https://api.github.com/repos/coltfred/davenport/languages","stargazers_url":"https://api.github.com/repos/coltfred/davenport/stargazers","contributors_url":"https://api.github.com/repos/coltfred/davenport/contributors","subscribers_url":"https://api.github.com/repos/coltfred/davenport/subscribers","subscription_url":"https://api.github.com/repos/coltfred/davenport/subscription","commits_url":"https://api.github.com/repos/coltfred/davenport/commits{/sha}","git_commits_url":"https://api.github.com/repos/coltfred/davenport/git/commits{/sha}","comments_url":"https://api.github.com/repos/coltfred/davenport/comments{/number}","issue_comment_url":"https://api.github.com/repos/coltfred/davenport/issues/comments{/number}","contents_url":"https://api.github.com/repos/coltfred/davenport/contents/{+path}","compare_url":"https://api.github.com/repos/coltfred/davenport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coltfred/davenport/merges","archive_url":"https://api.github.com/repos/coltfred/davenport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coltfred/davenport/downloads","issues_url":"https://api.github.com/repos/coltfred/davenport/issues{/number}","pulls_url":"https://api.github.com/repos/coltfred/davenport/pulls{/number}","milestones_url":"https://api.github.com/repos/coltfred/davenport/milestones{/number}","notifications_url":"https://api.github.com/repos/coltfred/davenport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coltfred/davenport/labels{/name}","releases_url":"https://api.github.com/repos/coltfred/davenport/releases{/id}","created_at":"2015-08-21T02:46:20Z","updated_at":"2015-08-21T02:46:21Z","pushed_at":"2015-10-03T03:24:42Z","git_url":"git://github.com/coltfred/davenport.git","ssh_url":"git@github.com:coltfred/davenport.git","clone_url":"https://github.com/coltfred/davenport.git","svn_url":"https://github.com/coltfred/davenport","homepage":null,"size":290,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"IronCoreLabs:master","ref":"master","sha":"5492d98ed7c62b53be59f0bb5dc7299fcd6294bb","user":{"login":"IronCoreLabs","id":11394047,"avatar_url":"https://avatars.githubusercontent.com/u/11394047?v=3","gravatar_id":"","url":"https://api.github.com/users/IronCoreLabs","html_url":"https://github.com/IronCoreLabs","followers_url":"https://api.github.com/users/IronCoreLabs/followers","following_url":"https://api.github.com/users/IronCoreLabs/following{/other_user}","gists_url":"https://api.github.com/users/IronCoreLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/IronCoreLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IronCoreLabs/subscriptions","organizations_url":"https://api.github.com/users/IronCoreLabs/orgs","repos_url":"https://api.github.com/users/IronCoreLabs/repos","events_url":"https://api.github.com/users/IronCoreLabs/events{/privacy}","received_events_url":"https://api.github.com/users/IronCoreLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":41042360,"name":"davenport","full_name":"IronCoreLabs/davenport","owner":{"login":"IronCoreLabs","id":11394047,"avatar_url":"https://avatars.githubusercontent.com/u/11394047?v=3","gravatar_id":"","url":"https://api.github.com/users/IronCoreLabs","html_url":"https://github.com/IronCoreLabs","followers_url":"https://api.github.com/users/IronCoreLabs/followers","following_url":"https://api.github.com/users/IronCoreLabs/following{/other_user}","gists_url":"https://api.github.com/users/IronCoreLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/IronCoreLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IronCoreLabs/subscriptions","organizations_url":"https://api.github.com/users/IronCoreLabs/orgs","repos_url":"https://api.github.com/users/IronCoreLabs/repos","events_url":"https://api.github.com/users/IronCoreLabs/events{/privacy}","received_events_url":"https://api.github.com/users/IronCoreLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IronCoreLabs/davenport","description":"A principled CouchBase library for Scala","fork":false,"url":"https://api.github.com/repos/IronCoreLabs/davenport","forks_url":"https://api.github.com/repos/IronCoreLabs/davenport/forks","keys_url":"https://api.github.com/repos/IronCoreLabs/davenport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IronCoreLabs/davenport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IronCoreLabs/davenport/teams","hooks_url":"https://api.github.com/repos/IronCoreLabs/davenport/hooks","issue_events_url":"https://api.github.com/repos/IronCoreLabs/davenport/issues/events{/number}","events_url":"https://api.github.com/repos/IronCoreLabs/davenport/events","assignees_url":"https://api.github.com/repos/IronCoreLabs/davenport/assignees{/user}","branches_url":"https://api.github.com/repos/IronCoreLabs/davenport/branches{/branch}","tags_url":"https://api.github.com/repos/IronCoreLabs/davenport/tags","blobs_url":"https://api.github.com/repos/IronCoreLabs/davenport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IronCoreLabs/davenport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IronCoreLabs/davenport/git/refs{/sha}","trees_url":"https://api.github.com/repos/IronCoreLabs/davenport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IronCoreLabs/davenport/statuses/{sha}","languages_url":"https://api.github.com/repos/IronCoreLabs/davenport/languages","stargazers_url":"https://api.github.com/repos/IronCoreLabs/davenport/stargazers","contributors_url":"https://api.github.com/repos/IronCoreLabs/davenport/contributors","subscribers_url":"https://api.github.com/repos/IronCoreLabs/davenport/subscribers","subscription_url":"https://api.github.com/repos/IronCoreLabs/davenport/subscription","commits_url":"https://api.github.com/repos/IronCoreLabs/davenport/commits{/sha}","git_commits_url":"https://api.github.com/repos/IronCoreLabs/davenport/git/commits{/sha}","comments_url":"https://api.github.com/repos/IronCoreLabs/davenport/comments{/number}","issue_comment_url":"https://api.github.com/repos/IronCoreLabs/davenport/issues/comments{/number}","contents_url":"https://api.github.com/repos/IronCoreLabs/davenport/contents/{+path}","compare_url":"https://api.github.com/repos/IronCoreLabs/davenport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IronCoreLabs/davenport/merges","archive_url":"https://api.github.com/repos/IronCoreLabs/davenport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IronCoreLabs/davenport/downloads","issues_url":"https://api.github.com/repos/IronCoreLabs/davenport/issues{/number}","pulls_url":"https://api.github.com/repos/IronCoreLabs/davenport/pulls{/number}","milestones_url":"https://api.github.com/repos/IronCoreLabs/davenport/milestones{/number}","notifications_url":"https://api.github.com/repos/IronCoreLabs/davenport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IronCoreLabs/davenport/labels{/name}","releases_url":"https://api.github.com/repos/IronCoreLabs/davenport/releases{/id}","created_at":"2015-08-19T15:22:43Z","updated_at":"2015-08-27T04:12:40Z","pushed_at":"2015-10-03T15:26:48Z","git_url":"git://github.com/IronCoreLabs/davenport.git","ssh_url":"git@github.com:IronCoreLabs/davenport.git","clone_url":"https://github.com/IronCoreLabs/davenport.git","svn_url":"https://github.com/IronCoreLabs/davenport","homepage":"https://ironcorelabs.com/davenport","size":787,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/21"},"html":{"href":"https://github.com/IronCoreLabs/davenport/pull/21"},"issue":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/issues/21"},"comments":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/IronCoreLabs/davenport/statuses/1cf23f271df6886f8fcf69fd30ba23563de7e3a2"}}}}