{"action":"created","comment":{"url":"https://api.github.com/repos/matej494/Marsiple/pulls/comments/203654550","pull_request_review_id":138585065,"id":203654550,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzY1NDU1MA==","diff_hunk":"@@ -8,24 +8,44 @@\n \n import Foundation\n \n+enum PostsFetcherError: LocalizedError {\n+    case urlCreationFailure\n+    case dataUnwrapingFailure\n+    case parsingDataFailure\n+    case generic(Error)\n+    \n+    var errorDescription: String? {\n+        switch self {\n+        case .urlCreationFailure:\n+            return \"Error creating URL.\"\n+        case .dataUnwrapingFailure:\n+            return \"Error unwrapping data.\"\n+        case .parsingDataFailure:\n+            return \"Error parsing data.\"\n+        case .generic(let error):\n+            return error.localizedDescription\n+        }\n+    }\n+}\n+\n struct PostsFetcher {\n-    func get(succes: @escaping ([Post]) -> Void, faliure: @escaping (String) -> Void) {\n-        guard let url = URL(string: MartianApi.url + \"/posts\")\n-            else { return DispatchQueue.main.async { faliure(\"Error creating URL.\") } }\n+    func get(success: @escaping ([Post]) -> Void, failure: @escaping (LocalizedError) -> Void) {\n+        guard let url = MartianApi.url?.appendingPathComponent(\"/posts\")","path":"Marsiple/Common/Network/PostsFetcher.swift","position":null,"original_position":29,"commit_id":"3d6b43d06b4662b41605e61646b05b025590e3b0","original_commit_id":"3d6b43d06b4662b41605e61646b05b025590e3b0","user":{"login":"matej494","id":17622830,"node_id":"MDQ6VXNlcjE3NjIyODMw","avatar_url":"https://avatars1.githubusercontent.com/u/17622830?v=4","gravatar_id":"","url":"https://api.github.com/users/matej494","html_url":"https://github.com/matej494","followers_url":"https://api.github.com/users/matej494/followers","following_url":"https://api.github.com/users/matej494/following{/other_user}","gists_url":"https://api.github.com/users/matej494/gists{/gist_id}","starred_url":"https://api.github.com/users/matej494/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej494/subscriptions","organizations_url":"https://api.github.com/users/matej494/orgs","repos_url":"https://api.github.com/users/matej494/repos","events_url":"https://api.github.com/users/matej494/events{/privacy}","received_events_url":"https://api.github.com/users/matej494/received_events","type":"User","site_admin":false},"body":"Didn't know it adds `/` itself. It says in the method description, if I know this is a directory I should use `appendingPathComponent(pathComponent: #String#, isDirectory:#Bool#)` form.","created_at":"2018-07-19T09:13:32Z","updated_at":"2018-07-19T09:13:32Z","html_url":"https://github.com/matej494/Marsiple/pull/2#discussion_r203654550","pull_request_url":"https://api.github.com/repos/matej494/Marsiple/pulls/2","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/matej494/Marsiple/pulls/comments/203654550"},"html":{"href":"https://github.com/matej494/Marsiple/pull/2#discussion_r203654550"},"pull_request":{"href":"https://api.github.com/repos/matej494/Marsiple/pulls/2"}},"in_reply_to_id":203635874},"pull_request":{"url":"https://api.github.com/repos/matej494/Marsiple/pulls/2","id":202225872,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMjI1ODcy","html_url":"https://github.com/matej494/Marsiple/pull/2","diff_url":"https://github.com/matej494/Marsiple/pull/2.diff","patch_url":"https://github.com/matej494/Marsiple/pull/2.patch","issue_url":"https://api.github.com/repos/matej494/Marsiple/issues/2","number":2,"state":"open","locked":false,"title":"Fetching posts","user":{"login":"matej494","id":17622830,"node_id":"MDQ6VXNlcjE3NjIyODMw","avatar_url":"https://avatars1.githubusercontent.com/u/17622830?v=4","gravatar_id":"","url":"https://api.github.com/users/matej494","html_url":"https://github.com/matej494","followers_url":"https://api.github.com/users/matej494/followers","following_url":"https://api.github.com/users/matej494/following{/other_user}","gists_url":"https://api.github.com/users/matej494/gists{/gist_id}","starred_url":"https://api.github.com/users/matej494/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej494/subscriptions","organizations_url":"https://api.github.com/users/matej494/orgs","repos_url":"https://api.github.com/users/matej494/repos","events_url":"https://api.github.com/users/matej494/events{/privacy}","received_events_url":"https://api.github.com/users/matej494/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-18T11:45:26Z","updated_at":"2018-07-19T09:13:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"998cbe78d46586f1fe00b6e69cb992c014e8cd4d","assignee":{"login":"matej494","id":17622830,"node_id":"MDQ6VXNlcjE3NjIyODMw","avatar_url":"https://avatars1.githubusercontent.com/u/17622830?v=4","gravatar_id":"","url":"https://api.github.com/users/matej494","html_url":"https://github.com/matej494","followers_url":"https://api.github.com/users/matej494/followers","following_url":"https://api.github.com/users/matej494/following{/other_user}","gists_url":"https://api.github.com/users/matej494/gists{/gist_id}","starred_url":"https://api.github.com/users/matej494/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej494/subscriptions","organizations_url":"https://api.github.com/users/matej494/orgs","repos_url":"https://api.github.com/users/matej494/repos","events_url":"https://api.github.com/users/matej494/events{/privacy}","received_events_url":"https://api.github.com/users/matej494/received_events","type":"User","site_admin":false},"assignees":[{"login":"matej494","id":17622830,"node_id":"MDQ6VXNlcjE3NjIyODMw","avatar_url":"https://avatars1.githubusercontent.com/u/17622830?v=4","gravatar_id":"","url":"https://api.github.com/users/matej494","html_url":"https://github.com/matej494","followers_url":"https://api.github.com/users/matej494/followers","following_url":"https://api.github.com/users/matej494/following{/other_user}","gists_url":"https://api.github.com/users/matej494/gists{/gist_id}","starred_url":"https://api.github.com/users/matej494/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej494/subscriptions","organizations_url":"https://api.github.com/users/matej494/orgs","repos_url":"https://api.github.com/users/matej494/repos","events_url":"https://api.github.com/users/matej494/events{/privacy}","received_events_url":"https://api.github.com/users/matej494/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":995074141,"node_id":"MDU6TGFiZWw5OTUwNzQxNDE=","url":"https://api.github.com/repos/matej494/Marsiple/labels/requested%20changes","name":"requested changes","color":"98A02B","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/matej494/Marsiple/pulls/2/commits","review_comments_url":"https://api.github.com/repos/matej494/Marsiple/pulls/2/comments","review_comment_url":"https://api.github.com/repos/matej494/Marsiple/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matej494/Marsiple/issues/2/comments","statuses_url":"https://api.github.com/repos/matej494/Marsiple/statuses/3d6b43d06b4662b41605e61646b05b025590e3b0","head":{"label":"matej494:feature/posts/fetching-data","ref":"feature/posts/fetching-data","sha":"3d6b43d06b4662b41605e61646b05b025590e3b0","user":{"login":"matej494","id":17622830,"node_id":"MDQ6VXNlcjE3NjIyODMw","avatar_url":"https://avatars1.githubusercontent.com/u/17622830?v=4","gravatar_id":"","url":"https://api.github.com/users/matej494","html_url":"https://github.com/matej494","followers_url":"https://api.github.com/users/matej494/followers","following_url":"https://api.github.com/users/matej494/following{/other_user}","gists_url":"https://api.github.com/users/matej494/gists{/gist_id}","starred_url":"https://api.github.com/users/matej494/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej494/subscriptions","organizations_url":"https://api.github.com/users/matej494/orgs","repos_url":"https://api.github.com/users/matej494/repos","events_url":"https://api.github.com/users/matej494/events{/privacy}","received_events_url":"https://api.github.com/users/matej494/received_events","type":"User","site_admin":false},"repo":{"id":141112055,"node_id":"MDEwOlJlcG9zaXRvcnkxNDExMTIwNTU=","name":"Marsiple","full_name":"matej494/Marsiple","owner":{"login":"matej494","id":17622830,"node_id":"MDQ6VXNlcjE3NjIyODMw","avatar_url":"https://avatars1.githubusercontent.com/u/17622830?v=4","gravatar_id":"","url":"https://api.github.com/users/matej494","html_url":"https://github.com/matej494","followers_url":"https://api.github.com/users/matej494/followers","following_url":"https://api.github.com/users/matej494/following{/other_user}","gists_url":"https://api.github.com/users/matej494/gists{/gist_id}","starred_url":"https://api.github.com/users/matej494/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej494/subscriptions","organizations_url":"https://api.github.com/users/matej494/orgs","repos_url":"https://api.github.com/users/matej494/repos","events_url":"https://api.github.com/users/matej494/events{/privacy}","received_events_url":"https://api.github.com/users/matej494/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matej494/Marsiple","description":"Demo iOS application that’s used for trainee education.","fork":false,"url":"https://api.github.com/repos/matej494/Marsiple","forks_url":"https://api.github.com/repos/matej494/Marsiple/forks","keys_url":"https://api.github.com/repos/matej494/Marsiple/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matej494/Marsiple/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matej494/Marsiple/teams","hooks_url":"https://api.github.com/repos/matej494/Marsiple/hooks","issue_events_url":"https://api.github.com/repos/matej494/Marsiple/issues/events{/number}","events_url":"https://api.github.com/repos/matej494/Marsiple/events","assignees_url":"https://api.github.com/repos/matej494/Marsiple/assignees{/user}","branches_url":"https://api.github.com/repos/matej494/Marsiple/branches{/branch}","tags_url":"https://api.github.com/repos/matej494/Marsiple/tags","blobs_url":"https://api.github.com/repos/matej494/Marsiple/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matej494/Marsiple/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matej494/Marsiple/git/refs{/sha}","trees_url":"https://api.github.com/repos/matej494/Marsiple/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matej494/Marsiple/statuses/{sha}","languages_url":"https://api.github.com/repos/matej494/Marsiple/languages","stargazers_url":"https://api.github.com/repos/matej494/Marsiple/stargazers","contributors_url":"https://api.github.com/repos/matej494/Marsiple/contributors","subscribers_url":"https://api.github.com/repos/matej494/Marsiple/subscribers","subscription_url":"https://api.github.com/repos/matej494/Marsiple/subscription","commits_url":"https://api.github.com/repos/matej494/Marsiple/commits{/sha}","git_commits_url":"https://api.github.com/repos/matej494/Marsiple/git/commits{/sha}","comments_url":"https://api.github.com/repos/matej494/Marsiple/comments{/number}","issue_comment_url":"https://api.github.com/repos/matej494/Marsiple/issues/comments{/number}","contents_url":"https://api.github.com/repos/matej494/Marsiple/contents/{+path}","compare_url":"https://api.github.com/repos/matej494/Marsiple/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matej494/Marsiple/merges","archive_url":"https://api.github.com/repos/matej494/Marsiple/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matej494/Marsiple/downloads","issues_url":"https://api.github.com/repos/matej494/Marsiple/issues{/number}","pulls_url":"https://api.github.com/repos/matej494/Marsiple/pulls{/number}","milestones_url":"https://api.github.com/repos/matej494/Marsiple/milestones{/number}","notifications_url":"https://api.github.com/repos/matej494/Marsiple/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matej494/Marsiple/labels{/name}","releases_url":"https://api.github.com/repos/matej494/Marsiple/releases{/id}","deployments_url":"https://api.github.com/repos/matej494/Marsiple/deployments","created_at":"2018-07-16T08:48:48Z","updated_at":"2018-07-16T15:43:20Z","pushed_at":"2018-07-19T08:40:12Z","git_url":"git://github.com/matej494/Marsiple.git","ssh_url":"git@github.com:matej494/Marsiple.git","clone_url":"https://github.com/matej494/Marsiple.git","svn_url":"https://github.com/matej494/Marsiple","homepage":null,"size":4944,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"matej494:feature/posts/posts","ref":"feature/posts/posts","sha":"cc37a42ea366cbcddf7d7f47157c6b06d8c080cc","user":{"login":"matej494","id":17622830,"node_id":"MDQ6VXNlcjE3NjIyODMw","avatar_url":"https://avatars1.githubusercontent.com/u/17622830?v=4","gravatar_id":"","url":"https://api.github.com/users/matej494","html_url":"https://github.com/matej494","followers_url":"https://api.github.com/users/matej494/followers","following_url":"https://api.github.com/users/matej494/following{/other_user}","gists_url":"https://api.github.com/users/matej494/gists{/gist_id}","starred_url":"https://api.github.com/users/matej494/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej494/subscriptions","organizations_url":"https://api.github.com/users/matej494/orgs","repos_url":"https://api.github.com/users/matej494/repos","events_url":"https://api.github.com/users/matej494/events{/privacy}","received_events_url":"https://api.github.com/users/matej494/received_events","type":"User","site_admin":false},"repo":{"id":141112055,"node_id":"MDEwOlJlcG9zaXRvcnkxNDExMTIwNTU=","name":"Marsiple","full_name":"matej494/Marsiple","owner":{"login":"matej494","id":17622830,"node_id":"MDQ6VXNlcjE3NjIyODMw","avatar_url":"https://avatars1.githubusercontent.com/u/17622830?v=4","gravatar_id":"","url":"https://api.github.com/users/matej494","html_url":"https://github.com/matej494","followers_url":"https://api.github.com/users/matej494/followers","following_url":"https://api.github.com/users/matej494/following{/other_user}","gists_url":"https://api.github.com/users/matej494/gists{/gist_id}","starred_url":"https://api.github.com/users/matej494/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej494/subscriptions","organizations_url":"https://api.github.com/users/matej494/orgs","repos_url":"https://api.github.com/users/matej494/repos","events_url":"https://api.github.com/users/matej494/events{/privacy}","received_events_url":"https://api.github.com/users/matej494/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matej494/Marsiple","description":"Demo iOS application that’s used for trainee education.","fork":false,"url":"https://api.github.com/repos/matej494/Marsiple","forks_url":"https://api.github.com/repos/matej494/Marsiple/forks","keys_url":"https://api.github.com/repos/matej494/Marsiple/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matej494/Marsiple/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matej494/Marsiple/teams","hooks_url":"https://api.github.com/repos/matej494/Marsiple/hooks","issue_events_url":"https://api.github.com/repos/matej494/Marsiple/issues/events{/number}","events_url":"https://api.github.com/repos/matej494/Marsiple/events","assignees_url":"https://api.github.com/repos/matej494/Marsiple/assignees{/user}","branches_url":"https://api.github.com/repos/matej494/Marsiple/branches{/branch}","tags_url":"https://api.github.com/repos/matej494/Marsiple/tags","blobs_url":"https://api.github.com/repos/matej494/Marsiple/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matej494/Marsiple/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matej494/Marsiple/git/refs{/sha}","trees_url":"https://api.github.com/repos/matej494/Marsiple/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matej494/Marsiple/statuses/{sha}","languages_url":"https://api.github.com/repos/matej494/Marsiple/languages","stargazers_url":"https://api.github.com/repos/matej494/Marsiple/stargazers","contributors_url":"https://api.github.com/repos/matej494/Marsiple/contributors","subscribers_url":"https://api.github.com/repos/matej494/Marsiple/subscribers","subscription_url":"https://api.github.com/repos/matej494/Marsiple/subscription","commits_url":"https://api.github.com/repos/matej494/Marsiple/commits{/sha}","git_commits_url":"https://api.github.com/repos/matej494/Marsiple/git/commits{/sha}","comments_url":"https://api.github.com/repos/matej494/Marsiple/comments{/number}","issue_comment_url":"https://api.github.com/repos/matej494/Marsiple/issues/comments{/number}","contents_url":"https://api.github.com/repos/matej494/Marsiple/contents/{+path}","compare_url":"https://api.github.com/repos/matej494/Marsiple/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matej494/Marsiple/merges","archive_url":"https://api.github.com/repos/matej494/Marsiple/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matej494/Marsiple/downloads","issues_url":"https://api.github.com/repos/matej494/Marsiple/issues{/number}","pulls_url":"https://api.github.com/repos/matej494/Marsiple/pulls{/number}","milestones_url":"https://api.github.com/repos/matej494/Marsiple/milestones{/number}","notifications_url":"https://api.github.com/repos/matej494/Marsiple/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matej494/Marsiple/labels{/name}","releases_url":"https://api.github.com/repos/matej494/Marsiple/releases{/id}","deployments_url":"https://api.github.com/repos/matej494/Marsiple/deployments","created_at":"2018-07-16T08:48:48Z","updated_at":"2018-07-16T15:43:20Z","pushed_at":"2018-07-19T08:40:12Z","git_url":"git://github.com/matej494/Marsiple.git","ssh_url":"git@github.com:matej494/Marsiple.git","clone_url":"https://github.com/matej494/Marsiple.git","svn_url":"https://github.com/matej494/Marsiple","homepage":null,"size":4944,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/matej494/Marsiple/pulls/2"},"html":{"href":"https://github.com/matej494/Marsiple/pull/2"},"issue":{"href":"https://api.github.com/repos/matej494/Marsiple/issues/2"},"comments":{"href":"https://api.github.com/repos/matej494/Marsiple/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/matej494/Marsiple/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/matej494/Marsiple/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matej494/Marsiple/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/matej494/Marsiple/statuses/3d6b43d06b4662b41605e61646b05b025590e3b0"}},"author_association":"OWNER"}}
{"actor":{"display_login":"matej494"}}