{"action":"created","comment":{"url":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/comments/185202688","pull_request_review_id":116543120,"id":185202688,"diff_hunk":"@@ -157,34 +161,30 @@ data class BaseClient(\n \n         val call: Call = httpClient.newCall(request)\n \n-        onCancel { if (!call.isCanceled) call.cancel() }\n-\n-        call.enqueue(object : Callback {\n-            override fun onResponse(call: Call?, response: Response?) {\n-                when (response?.code()) {\n-                    null -> report(OtherError(\"Response was null\").asFailure())\n-                    in 200..299 -> report(response.asSuccess())\n-                    else -> {\n-                        val error = response.body()?.charStream()\n-                            .parseOr { ErrorResponseBody(\"could not parse error response: $response\") }\n-                            .map { b ->\n-                                Errors.response(\n-                                    statusCode = response.code(),\n-                                    headers = response.headers().toMultimap(),\n-                                    error = b.error,\n-                                    errorDescription = b.errorDescription,\n-                                    URI = b.URI\n-                                )\n-                            }.recover { it }\n-                        report(error.asFailure())\n-                    }\n-                }\n-            }\n+        val response = call.execute()\n \n-            override fun onFailure(call: Call?, e: IOException?) {\n-                report(NetworkError(\"Request error: ${e?.toString()}\").asFailure())\n+        when (response?.code()) {\n+            null -> OtherError(\"Response was null\").asFailure<Response, Error>()\n+            in 200..299 -> {\n+                logger.verbose(\"Request OK: $method $requestDestination with status code: ${response.code()} \")\n+                response.asSuccess()\n+            }\n+            else -> {\n+                logger.verbose(\"Request Failed: $method $requestDestination with status code: ${response.code()}\")\n+                val error = response.body()?.charStream()\n+                    .parseOr { ErrorResponseBody(\"could not parse error response: $response\") }\n+                    .map { b ->\n+                        Errors.response(","path":"pusher-platform-core/src/main/kotlin/com/pusher/platform/BaseClient.kt","position":121,"original_position":121,"commit_id":"9fb85bee71f120bd7b5a5ea46ec49aeee5d80f5d","original_commit_id":"9fb85bee71f120bd7b5a5ea46ec49aeee5d80f5d","user":{"login":"pablisco","id":260697,"avatar_url":"https://avatars2.githubusercontent.com/u/260697?v=4","gravatar_id":"","url":"https://api.github.com/users/pablisco","html_url":"https://github.com/pablisco","followers_url":"https://api.github.com/users/pablisco/followers","following_url":"https://api.github.com/users/pablisco/following{/other_user}","gists_url":"https://api.github.com/users/pablisco/gists{/gist_id}","starred_url":"https://api.github.com/users/pablisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pablisco/subscriptions","organizations_url":"https://api.github.com/users/pablisco/orgs","repos_url":"https://api.github.com/users/pablisco/repos","events_url":"https://api.github.com/users/pablisco/events{/privacy}","received_events_url":"https://api.github.com/users/pablisco/received_events","type":"User","site_admin":false},"body":"ok, @hamchapman Do you mind creating a card explaining this? We can talk about it too. I'm not 100% sure what it entails","created_at":"2018-05-01T11:02:26Z","updated_at":"2018-05-01T11:02:30Z","html_url":"https://github.com/pusher/pusher-platform-android/pull/38#discussion_r185202688","pull_request_url":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/38","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/comments/185202688"},"html":{"href":"https://github.com/pusher/pusher-platform-android/pull/38#discussion_r185202688"},"pull_request":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/38"}},"in_reply_to_id":185188389},"pull_request":{"url":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/38","id":184920164,"html_url":"https://github.com/pusher/pusher-platform-android/pull/38","diff_url":"https://github.com/pusher/pusher-platform-android/pull/38.diff","patch_url":"https://github.com/pusher/pusher-platform-android/pull/38.patch","issue_url":"https://api.github.com/repos/pusher/pusher-platform-android/issues/38","number":38,"state":"open","locked":false,"title":"Removed promises","user":{"login":"pablisco","id":260697,"avatar_url":"https://avatars2.githubusercontent.com/u/260697?v=4","gravatar_id":"","url":"https://api.github.com/users/pablisco","html_url":"https://github.com/pablisco","followers_url":"https://api.github.com/users/pablisco/followers","following_url":"https://api.github.com/users/pablisco/following{/other_user}","gists_url":"https://api.github.com/users/pablisco/gists{/gist_id}","starred_url":"https://api.github.com/users/pablisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pablisco/subscriptions","organizations_url":"https://api.github.com/users/pablisco/orgs","repos_url":"https://api.github.com/users/pablisco/repos","events_url":"https://api.github.com/users/pablisco/events{/privacy}","received_events_url":"https://api.github.com/users/pablisco/received_events","type":"User","site_admin":false},"body":"- Removed `Promise` type\r\n- Add utilities for `Future` types (standard Java)\r\n- inlined type alias for `Promise`\r\n- Updated tests\r\n\r\n![](http://beginningwithin.com/wp-content/uploads/2017/01/Future-Now-1-1024x494.jpg)\r\n\r\n","created_at":"2018-04-30T10:11:50Z","updated_at":"2018-05-01T11:02:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cad845fc81e598a16981c2ddee3401d52be378f6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/38/commits","review_comments_url":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/38/comments","review_comment_url":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pusher/pusher-platform-android/issues/38/comments","statuses_url":"https://api.github.com/repos/pusher/pusher-platform-android/statuses/9fb85bee71f120bd7b5a5ea46ec49aeee5d80f5d","head":{"label":"pusher:futures","ref":"futures","sha":"9fb85bee71f120bd7b5a5ea46ec49aeee5d80f5d","user":{"login":"pusher","id":739550,"avatar_url":"https://avatars0.githubusercontent.com/u/739550?v=4","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"repo":{"id":79348896,"name":"pusher-platform-android","full_name":"pusher/pusher-platform-android","owner":{"login":"pusher","id":739550,"avatar_url":"https://avatars0.githubusercontent.com/u/739550?v=4","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pusher/pusher-platform-android","description":"Pusher Platform SDK for Android","fork":false,"url":"https://api.github.com/repos/pusher/pusher-platform-android","forks_url":"https://api.github.com/repos/pusher/pusher-platform-android/forks","keys_url":"https://api.github.com/repos/pusher/pusher-platform-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pusher/pusher-platform-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pusher/pusher-platform-android/teams","hooks_url":"https://api.github.com/repos/pusher/pusher-platform-android/hooks","issue_events_url":"https://api.github.com/repos/pusher/pusher-platform-android/issues/events{/number}","events_url":"https://api.github.com/repos/pusher/pusher-platform-android/events","assignees_url":"https://api.github.com/repos/pusher/pusher-platform-android/assignees{/user}","branches_url":"https://api.github.com/repos/pusher/pusher-platform-android/branches{/branch}","tags_url":"https://api.github.com/repos/pusher/pusher-platform-android/tags","blobs_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pusher/pusher-platform-android/statuses/{sha}","languages_url":"https://api.github.com/repos/pusher/pusher-platform-android/languages","stargazers_url":"https://api.github.com/repos/pusher/pusher-platform-android/stargazers","contributors_url":"https://api.github.com/repos/pusher/pusher-platform-android/contributors","subscribers_url":"https://api.github.com/repos/pusher/pusher-platform-android/subscribers","subscription_url":"https://api.github.com/repos/pusher/pusher-platform-android/subscription","commits_url":"https://api.github.com/repos/pusher/pusher-platform-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/pusher/pusher-platform-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/pusher/pusher-platform-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/pusher/pusher-platform-android/contents/{+path}","compare_url":"https://api.github.com/repos/pusher/pusher-platform-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pusher/pusher-platform-android/merges","archive_url":"https://api.github.com/repos/pusher/pusher-platform-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pusher/pusher-platform-android/downloads","issues_url":"https://api.github.com/repos/pusher/pusher-platform-android/issues{/number}","pulls_url":"https://api.github.com/repos/pusher/pusher-platform-android/pulls{/number}","milestones_url":"https://api.github.com/repos/pusher/pusher-platform-android/milestones{/number}","notifications_url":"https://api.github.com/repos/pusher/pusher-platform-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pusher/pusher-platform-android/labels{/name}","releases_url":"https://api.github.com/repos/pusher/pusher-platform-android/releases{/id}","deployments_url":"https://api.github.com/repos/pusher/pusher-platform-android/deployments","created_at":"2017-01-18T14:40:40Z","updated_at":"2018-04-27T12:47:27Z","pushed_at":"2018-05-01T10:58:23Z","git_url":"git://github.com/pusher/pusher-platform-android.git","ssh_url":"git@github.com:pusher/pusher-platform-android.git","clone_url":"https://github.com/pusher/pusher-platform-android.git","svn_url":"https://github.com/pusher/pusher-platform-android","homepage":"","size":709,"stargazers_count":5,"watchers_count":5,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":4,"watchers":5,"default_branch":"master"}},"base":{"label":"pusher:master","ref":"master","sha":"0f5fb1e0b6e292bd0477fe5fd16a8f0fa5c16b05","user":{"login":"pusher","id":739550,"avatar_url":"https://avatars0.githubusercontent.com/u/739550?v=4","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"repo":{"id":79348896,"name":"pusher-platform-android","full_name":"pusher/pusher-platform-android","owner":{"login":"pusher","id":739550,"avatar_url":"https://avatars0.githubusercontent.com/u/739550?v=4","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pusher/pusher-platform-android","description":"Pusher Platform SDK for Android","fork":false,"url":"https://api.github.com/repos/pusher/pusher-platform-android","forks_url":"https://api.github.com/repos/pusher/pusher-platform-android/forks","keys_url":"https://api.github.com/repos/pusher/pusher-platform-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pusher/pusher-platform-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pusher/pusher-platform-android/teams","hooks_url":"https://api.github.com/repos/pusher/pusher-platform-android/hooks","issue_events_url":"https://api.github.com/repos/pusher/pusher-platform-android/issues/events{/number}","events_url":"https://api.github.com/repos/pusher/pusher-platform-android/events","assignees_url":"https://api.github.com/repos/pusher/pusher-platform-android/assignees{/user}","branches_url":"https://api.github.com/repos/pusher/pusher-platform-android/branches{/branch}","tags_url":"https://api.github.com/repos/pusher/pusher-platform-android/tags","blobs_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pusher/pusher-platform-android/statuses/{sha}","languages_url":"https://api.github.com/repos/pusher/pusher-platform-android/languages","stargazers_url":"https://api.github.com/repos/pusher/pusher-platform-android/stargazers","contributors_url":"https://api.github.com/repos/pusher/pusher-platform-android/contributors","subscribers_url":"https://api.github.com/repos/pusher/pusher-platform-android/subscribers","subscription_url":"https://api.github.com/repos/pusher/pusher-platform-android/subscription","commits_url":"https://api.github.com/repos/pusher/pusher-platform-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/pusher/pusher-platform-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/pusher/pusher-platform-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/pusher/pusher-platform-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/pusher/pusher-platform-android/contents/{+path}","compare_url":"https://api.github.com/repos/pusher/pusher-platform-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pusher/pusher-platform-android/merges","archive_url":"https://api.github.com/repos/pusher/pusher-platform-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pusher/pusher-platform-android/downloads","issues_url":"https://api.github.com/repos/pusher/pusher-platform-android/issues{/number}","pulls_url":"https://api.github.com/repos/pusher/pusher-platform-android/pulls{/number}","milestones_url":"https://api.github.com/repos/pusher/pusher-platform-android/milestones{/number}","notifications_url":"https://api.github.com/repos/pusher/pusher-platform-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pusher/pusher-platform-android/labels{/name}","releases_url":"https://api.github.com/repos/pusher/pusher-platform-android/releases{/id}","deployments_url":"https://api.github.com/repos/pusher/pusher-platform-android/deployments","created_at":"2017-01-18T14:40:40Z","updated_at":"2018-04-27T12:47:27Z","pushed_at":"2018-05-01T10:58:23Z","git_url":"git://github.com/pusher/pusher-platform-android.git","ssh_url":"git@github.com:pusher/pusher-platform-android.git","clone_url":"https://github.com/pusher/pusher-platform-android.git","svn_url":"https://github.com/pusher/pusher-platform-android","homepage":"","size":709,"stargazers_count":5,"watchers_count":5,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":4,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/38"},"html":{"href":"https://github.com/pusher/pusher-platform-android/pull/38"},"issue":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/issues/38"},"comments":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/pusher/pusher-platform-android/statuses/9fb85bee71f120bd7b5a5ea46ec49aeee5d80f5d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pablisco"}}