{"action":"created","comment":{"url":"https://api.github.com/repos/ishkawa/APIKit/pulls/comments/33115448","id":33115448,"diff_hunk":"@@ -0,0 +1,8 @@\n+import Foundation\n+\n+public enum APIKitError: ErrorType {\n+    case InvalidRequest","path":"APIKit/Errors.swift","position":4,"original_position":4,"commit_id":"ef3d410840cfe27fc26756162a9d4d91d282ba1d","original_commit_id":"ef3d410840cfe27fc26756162a9d4d91d282ba1d","user":{"login":"ikesyo","id":909674,"avatar_url":"https://avatars.githubusercontent.com/u/909674?v=3","gravatar_id":"","url":"https://api.github.com/users/ikesyo","html_url":"https://github.com/ikesyo","followers_url":"https://api.github.com/users/ikesyo/followers","following_url":"https://api.github.com/users/ikesyo/following{/other_user}","gists_url":"https://api.github.com/users/ikesyo/gists{/gist_id}","starred_url":"https://api.github.com/users/ikesyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikesyo/subscriptions","organizations_url":"https://api.github.com/users/ikesyo/orgs","repos_url":"https://api.github.com/users/ikesyo/repos","events_url":"https://api.github.com/users/ikesyo/events{/privacy}","received_events_url":"https://api.github.com/users/ikesyo/received_events","type":"User","site_admin":false},"body":"It's nice if there is more detailed error cause as a associated value.","created_at":"2015-06-24T03:49:01Z","updated_at":"2015-06-24T03:49:01Z","html_url":"https://github.com/ishkawa/APIKit/pull/49#discussion_r33115448","pull_request_url":"https://api.github.com/repos/ishkawa/APIKit/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/ishkawa/APIKit/pulls/comments/33115448"},"html":{"href":"https://github.com/ishkawa/APIKit/pull/49#discussion_r33115448"},"pull_request":{"href":"https://api.github.com/repos/ishkawa/APIKit/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/ishkawa/APIKit/pulls/49","id":37447693,"html_url":"https://github.com/ishkawa/APIKit/pull/49","diff_url":"https://github.com/ishkawa/APIKit/pull/49.diff","patch_url":"https://github.com/ishkawa/APIKit/pull/49.patch","issue_url":"https://api.github.com/repos/ishkawa/APIKit/issues/49","number":49,"state":"open","locked":false,"title":"Redesign for Swift 2","user":{"login":"ishkawa","id":966856,"avatar_url":"https://avatars.githubusercontent.com/u/966856?v=3","gravatar_id":"","url":"https://api.github.com/users/ishkawa","html_url":"https://github.com/ishkawa","followers_url":"https://api.github.com/users/ishkawa/followers","following_url":"https://api.github.com/users/ishkawa/following{/other_user}","gists_url":"https://api.github.com/users/ishkawa/gists{/gist_id}","starred_url":"https://api.github.com/users/ishkawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishkawa/subscriptions","organizations_url":"https://api.github.com/users/ishkawa/orgs","repos_url":"https://api.github.com/users/ishkawa/repos","events_url":"https://api.github.com/users/ishkawa/events{/privacy}","received_events_url":"https://api.github.com/users/ishkawa/received_events","type":"User","site_admin":false},"body":"NOTE: currently, this PR is a rough sketch of new design.\r\n\r\nSwift 2 is coming! I think redesigning APIKit for Swift 2 is necessary to take full advantage of it.\r\n\r\n- protocol extension makes `Reuqest` protocol more flexilble.\r\n- `ErrorType` is useful to express errors in APIKit.\r\n- `do-try-catch` introduced easier error handling model (if process is synchronous).\r\n\r\nHere are tasks:\r\n\r\n- [x] Move default configuration of request to extension of `Request`.\r\n- [x] Detailed and comprehensive errors using `ErrorType`.\r\n- [x] Adopt `do-try-catch` in synchronous error handling.\r\n\r\nAny comments are welcome.","created_at":"2015-06-11T10:08:05Z","updated_at":"2015-06-24T03:49:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2b34b8fce7a69cffc44c4c0dc17d3229cfd7e8c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ishkawa/APIKit/pulls/49/commits","review_comments_url":"https://api.github.com/repos/ishkawa/APIKit/pulls/49/comments","review_comment_url":"https://api.github.com/repos/ishkawa/APIKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ishkawa/APIKit/issues/49/comments","statuses_url":"https://api.github.com/repos/ishkawa/APIKit/statuses/ef3d410840cfe27fc26756162a9d4d91d282ba1d","head":{"label":"ishkawa:swift2","ref":"swift2","sha":"ef3d410840cfe27fc26756162a9d4d91d282ba1d","user":{"login":"ishkawa","id":966856,"avatar_url":"https://avatars.githubusercontent.com/u/966856?v=3","gravatar_id":"","url":"https://api.github.com/users/ishkawa","html_url":"https://github.com/ishkawa","followers_url":"https://api.github.com/users/ishkawa/followers","following_url":"https://api.github.com/users/ishkawa/following{/other_user}","gists_url":"https://api.github.com/users/ishkawa/gists{/gist_id}","starred_url":"https://api.github.com/users/ishkawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishkawa/subscriptions","organizations_url":"https://api.github.com/users/ishkawa/orgs","repos_url":"https://api.github.com/users/ishkawa/repos","events_url":"https://api.github.com/users/ishkawa/events{/privacy}","received_events_url":"https://api.github.com/users/ishkawa/received_events","type":"User","site_admin":false},"repo":{"id":30968293,"name":"APIKit","full_name":"ishkawa/APIKit","owner":{"login":"ishkawa","id":966856,"avatar_url":"https://avatars.githubusercontent.com/u/966856?v=3","gravatar_id":"","url":"https://api.github.com/users/ishkawa","html_url":"https://github.com/ishkawa","followers_url":"https://api.github.com/users/ishkawa/followers","following_url":"https://api.github.com/users/ishkawa/following{/other_user}","gists_url":"https://api.github.com/users/ishkawa/gists{/gist_id}","starred_url":"https://api.github.com/users/ishkawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishkawa/subscriptions","organizations_url":"https://api.github.com/users/ishkawa/orgs","repos_url":"https://api.github.com/users/ishkawa/repos","events_url":"https://api.github.com/users/ishkawa/events{/privacy}","received_events_url":"https://api.github.com/users/ishkawa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ishkawa/APIKit","description":"A networking library for building type safe web API client in Swift.","fork":false,"url":"https://api.github.com/repos/ishkawa/APIKit","forks_url":"https://api.github.com/repos/ishkawa/APIKit/forks","keys_url":"https://api.github.com/repos/ishkawa/APIKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ishkawa/APIKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ishkawa/APIKit/teams","hooks_url":"https://api.github.com/repos/ishkawa/APIKit/hooks","issue_events_url":"https://api.github.com/repos/ishkawa/APIKit/issues/events{/number}","events_url":"https://api.github.com/repos/ishkawa/APIKit/events","assignees_url":"https://api.github.com/repos/ishkawa/APIKit/assignees{/user}","branches_url":"https://api.github.com/repos/ishkawa/APIKit/branches{/branch}","tags_url":"https://api.github.com/repos/ishkawa/APIKit/tags","blobs_url":"https://api.github.com/repos/ishkawa/APIKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ishkawa/APIKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ishkawa/APIKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/ishkawa/APIKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ishkawa/APIKit/statuses/{sha}","languages_url":"https://api.github.com/repos/ishkawa/APIKit/languages","stargazers_url":"https://api.github.com/repos/ishkawa/APIKit/stargazers","contributors_url":"https://api.github.com/repos/ishkawa/APIKit/contributors","subscribers_url":"https://api.github.com/repos/ishkawa/APIKit/subscribers","subscription_url":"https://api.github.com/repos/ishkawa/APIKit/subscription","commits_url":"https://api.github.com/repos/ishkawa/APIKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/ishkawa/APIKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/ishkawa/APIKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/ishkawa/APIKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/ishkawa/APIKit/contents/{+path}","compare_url":"https://api.github.com/repos/ishkawa/APIKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ishkawa/APIKit/merges","archive_url":"https://api.github.com/repos/ishkawa/APIKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ishkawa/APIKit/downloads","issues_url":"https://api.github.com/repos/ishkawa/APIKit/issues{/number}","pulls_url":"https://api.github.com/repos/ishkawa/APIKit/pulls{/number}","milestones_url":"https://api.github.com/repos/ishkawa/APIKit/milestones{/number}","notifications_url":"https://api.github.com/repos/ishkawa/APIKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ishkawa/APIKit/labels{/name}","releases_url":"https://api.github.com/repos/ishkawa/APIKit/releases{/id}","created_at":"2015-02-18T14:16:16Z","updated_at":"2015-06-23T05:29:27Z","pushed_at":"2015-06-23T05:46:35Z","git_url":"git://github.com/ishkawa/APIKit.git","ssh_url":"git@github.com:ishkawa/APIKit.git","clone_url":"https://github.com/ishkawa/APIKit.git","svn_url":"https://github.com/ishkawa/APIKit","homepage":"","size":1522,"stargazers_count":268,"watchers_count":268,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":6,"forks":17,"open_issues":6,"watchers":268,"default_branch":"master"}},"base":{"label":"ishkawa:master","ref":"master","sha":"77ca0755252e5ddb9aee9487f426c061714ed16a","user":{"login":"ishkawa","id":966856,"avatar_url":"https://avatars.githubusercontent.com/u/966856?v=3","gravatar_id":"","url":"https://api.github.com/users/ishkawa","html_url":"https://github.com/ishkawa","followers_url":"https://api.github.com/users/ishkawa/followers","following_url":"https://api.github.com/users/ishkawa/following{/other_user}","gists_url":"https://api.github.com/users/ishkawa/gists{/gist_id}","starred_url":"https://api.github.com/users/ishkawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishkawa/subscriptions","organizations_url":"https://api.github.com/users/ishkawa/orgs","repos_url":"https://api.github.com/users/ishkawa/repos","events_url":"https://api.github.com/users/ishkawa/events{/privacy}","received_events_url":"https://api.github.com/users/ishkawa/received_events","type":"User","site_admin":false},"repo":{"id":30968293,"name":"APIKit","full_name":"ishkawa/APIKit","owner":{"login":"ishkawa","id":966856,"avatar_url":"https://avatars.githubusercontent.com/u/966856?v=3","gravatar_id":"","url":"https://api.github.com/users/ishkawa","html_url":"https://github.com/ishkawa","followers_url":"https://api.github.com/users/ishkawa/followers","following_url":"https://api.github.com/users/ishkawa/following{/other_user}","gists_url":"https://api.github.com/users/ishkawa/gists{/gist_id}","starred_url":"https://api.github.com/users/ishkawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishkawa/subscriptions","organizations_url":"https://api.github.com/users/ishkawa/orgs","repos_url":"https://api.github.com/users/ishkawa/repos","events_url":"https://api.github.com/users/ishkawa/events{/privacy}","received_events_url":"https://api.github.com/users/ishkawa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ishkawa/APIKit","description":"A networking library for building type safe web API client in Swift.","fork":false,"url":"https://api.github.com/repos/ishkawa/APIKit","forks_url":"https://api.github.com/repos/ishkawa/APIKit/forks","keys_url":"https://api.github.com/repos/ishkawa/APIKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ishkawa/APIKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ishkawa/APIKit/teams","hooks_url":"https://api.github.com/repos/ishkawa/APIKit/hooks","issue_events_url":"https://api.github.com/repos/ishkawa/APIKit/issues/events{/number}","events_url":"https://api.github.com/repos/ishkawa/APIKit/events","assignees_url":"https://api.github.com/repos/ishkawa/APIKit/assignees{/user}","branches_url":"https://api.github.com/repos/ishkawa/APIKit/branches{/branch}","tags_url":"https://api.github.com/repos/ishkawa/APIKit/tags","blobs_url":"https://api.github.com/repos/ishkawa/APIKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ishkawa/APIKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ishkawa/APIKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/ishkawa/APIKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ishkawa/APIKit/statuses/{sha}","languages_url":"https://api.github.com/repos/ishkawa/APIKit/languages","stargazers_url":"https://api.github.com/repos/ishkawa/APIKit/stargazers","contributors_url":"https://api.github.com/repos/ishkawa/APIKit/contributors","subscribers_url":"https://api.github.com/repos/ishkawa/APIKit/subscribers","subscription_url":"https://api.github.com/repos/ishkawa/APIKit/subscription","commits_url":"https://api.github.com/repos/ishkawa/APIKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/ishkawa/APIKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/ishkawa/APIKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/ishkawa/APIKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/ishkawa/APIKit/contents/{+path}","compare_url":"https://api.github.com/repos/ishkawa/APIKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ishkawa/APIKit/merges","archive_url":"https://api.github.com/repos/ishkawa/APIKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ishkawa/APIKit/downloads","issues_url":"https://api.github.com/repos/ishkawa/APIKit/issues{/number}","pulls_url":"https://api.github.com/repos/ishkawa/APIKit/pulls{/number}","milestones_url":"https://api.github.com/repos/ishkawa/APIKit/milestones{/number}","notifications_url":"https://api.github.com/repos/ishkawa/APIKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ishkawa/APIKit/labels{/name}","releases_url":"https://api.github.com/repos/ishkawa/APIKit/releases{/id}","created_at":"2015-02-18T14:16:16Z","updated_at":"2015-06-23T05:29:27Z","pushed_at":"2015-06-23T05:46:35Z","git_url":"git://github.com/ishkawa/APIKit.git","ssh_url":"git@github.com:ishkawa/APIKit.git","clone_url":"https://github.com/ishkawa/APIKit.git","svn_url":"https://github.com/ishkawa/APIKit","homepage":"","size":1522,"stargazers_count":268,"watchers_count":268,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":6,"forks":17,"open_issues":6,"watchers":268,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ishkawa/APIKit/pulls/49"},"html":{"href":"https://github.com/ishkawa/APIKit/pull/49"},"issue":{"href":"https://api.github.com/repos/ishkawa/APIKit/issues/49"},"comments":{"href":"https://api.github.com/repos/ishkawa/APIKit/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/ishkawa/APIKit/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/ishkawa/APIKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ishkawa/APIKit/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/ishkawa/APIKit/statuses/ef3d410840cfe27fc26756162a9d4d91d282ba1d"}}}}