{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-app-android/pulls/comments/66050470","id":66050470,"diff_hunk":"@@ -16,31 +17,43 @@\n \n     protected static final Logger logger = new Logger(ErrorUtils.class.getName());\n \n+    public static class Error {\n+        public MessageType type;\n+        public String message;\n+    }\n+\n     @NonNull\n     public static String getErrorMessage(@NonNull Throwable ex, @NonNull Context context) {\n-        String errorMessage = null;\n+        return getError(ex, context).message;\n+    }\n+\n+    @NonNull\n+    public static Error getError(@NonNull Throwable ex, @NonNull Context context) {\n+        Error errorObj = new Error();\n+        errorObj.type = MessageType.FLYIN_ERROR;\n         if (ex instanceof HttpConnectivityException) {\n             if (NetworkUtil.isConnected(context)) {\n-                errorMessage = context.getString(R.string.network_connected_error);\n+                errorObj.message = context.getString(R.string.network_connected_error);\n             } else {\n-                errorMessage = context.getString(R.string.reset_no_network_message);\n+                errorObj.message = context.getString(R.string.reset_no_network_message);\n             }\n         } else if (ex instanceof HttpResponseStatusException) {\n             final int status = ((HttpResponseStatusException) ex).getStatusCode();\n             switch (status) {\n                 case HttpURLConnection.HTTP_UNAVAILABLE:\n-                    errorMessage = context.getString(R.string.network_service_unavailable);\n+                    errorObj.message = context.getString(R.string.network_service_unavailable);\n                     break;\n                 case HttpURLConnection.HTTP_NOT_FOUND:\n                 case HttpURLConnection.HTTP_INTERNAL_ERROR:\n-                    errorMessage = context.getString(R.string.action_not_completed);\n+                    errorObj.message = context.getString(R.string.action_not_completed);\n+                    errorObj.type = MessageType.PERSISTENT_ERROR;","path":"VideoLocker/src/main/java/org/edx/mobile/util/images/ErrorUtils.java","position":null,"original_position":46,"commit_id":"e529d1bf23579255b9c0cf37d62c853869104e16","original_commit_id":"e529d1bf23579255b9c0cf37d62c853869104e16","user":{"login":"1zaman","id":4244109,"avatar_url":"https://avatars.githubusercontent.com/u/4244109?v=3","gravatar_id":"","url":"https://api.github.com/users/1zaman","html_url":"https://github.com/1zaman","followers_url":"https://api.github.com/users/1zaman/followers","following_url":"https://api.github.com/users/1zaman/following{/other_user}","gists_url":"https://api.github.com/users/1zaman/gists{/gist_id}","starred_url":"https://api.github.com/users/1zaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1zaman/subscriptions","organizations_url":"https://api.github.com/users/1zaman/orgs","repos_url":"https://api.github.com/users/1zaman/repos","events_url":"https://api.github.com/users/1zaman/events{/privacy}","received_events_url":"https://api.github.com/users/1zaman/received_events","type":"User","site_admin":false},"body":"According to the [Error Handling][] wiki, we should show a dialog only upon encountering error while delivering user-submitted data. As such, I propose that you should add an enum argument representing the nature of the request in the constructor of the base `Task` class, and choose the error display platform based on that.\r\n\r\n[Error Handling]: https://openedx.atlassian.net/wiki/pages/viewpage.action?pageId=83427604","created_at":"2016-06-07T11:08:30Z","updated_at":"2016-06-07T11:08:30Z","html_url":"https://github.com/edx/edx-app-android/pull/709#discussion_r66050470","pull_request_url":"https://api.github.com/repos/edx/edx-app-android/pulls/709","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/comments/66050470"},"html":{"href":"https://github.com/edx/edx-app-android/pull/709#discussion_r66050470"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/709"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-app-android/pulls/709","id":70369348,"html_url":"https://github.com/edx/edx-app-android/pull/709","diff_url":"https://github.com/edx/edx-app-android/pull/709.diff","patch_url":"https://github.com/edx/edx-app-android/pull/709.patch","issue_url":"https://api.github.com/repos/edx/edx-app-android/issues/709","number":709,"state":"open","locked":false,"title":"Dialogs for POST errors","user":{"login":"miankhalid","id":1710804,"avatar_url":"https://avatars.githubusercontent.com/u/1710804?v=3","gravatar_id":"","url":"https://api.github.com/users/miankhalid","html_url":"https://github.com/miankhalid","followers_url":"https://api.github.com/users/miankhalid/followers","following_url":"https://api.github.com/users/miankhalid/following{/other_user}","gists_url":"https://api.github.com/users/miankhalid/gists{/gist_id}","starred_url":"https://api.github.com/users/miankhalid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miankhalid/subscriptions","organizations_url":"https://api.github.com/users/miankhalid/orgs","repos_url":"https://api.github.com/users/miankhalid/repos","events_url":"https://api.github.com/users/miankhalid/events{/privacy}","received_events_url":"https://api.github.com/users/miankhalid/received_events","type":"User","site_admin":false},"body":"## Fixes [MA-2283](https://openedx.atlassian.net/browse/MA-2283)\r\n\r\n- New error message added for 404 and 500 status codes.\r\n- A persistent dialog now appears when we try to do an operation on a deleted thread, response or comment.\r\n\r\n## New Changes\r\nThe flying error messages have been re-instated with the exception of dialog errors for cases mentioned above, here's how it looks:\r\n\r\n<img src=\"https://cloud.githubusercontent.com/assets/1710804/15851900/678b9a14-2cb8-11e6-9e4c-e010168b718c.png\" width=\"250\" />\r\n\r\n## Obsolete Changes\r\n- Error message overlays don't persist on screen, take\r\nextra space and look weird anymore.\r\n\r\nHere's how the error message overlays looked before before (intentional duplication 😉 ) and now:\r\n\r\nBefore | Before | Now\r\n------------ | ------------- | -------------\r\n<img src=\"https://cloud.githubusercontent.com/assets/1710804/15326384/41339b8e-1c67-11e6-9d20-c55f2520c3a2.png\" width=\"250\" /> | <img src=\"https://cloud.githubusercontent.com/assets/1710804/15326387/42944924-1c67-11e6-975d-0008a7bdb32b.png\" width=\"250\" /> | <img src=\"https://cloud.githubusercontent.com/assets/1710804/15326393/4446c3f0-1c67-11e6-8bda-8128206f3504.png\" width=\"250\" />\r\n\r\n@1zaman @BenjiLee @aleffert @mdinino plz review","created_at":"2016-05-17T14:42:07Z","updated_at":"2016-06-07T11:08:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be998ea300c1e66d6efa5d9e3173d82ddf8e9bd3","assignee":null,"milestone":{"url":"https://api.github.com/repos/edx/edx-app-android/milestones/6","html_url":"https://github.com/edx/edx-app-android/milestones/General","labels_url":"https://api.github.com/repos/edx/edx-app-android/milestones/6/labels","id":1472412,"number":6,"title":"General","description":null,"creator":{"login":"miankhalid","id":1710804,"avatar_url":"https://avatars.githubusercontent.com/u/1710804?v=3","gravatar_id":"","url":"https://api.github.com/users/miankhalid","html_url":"https://github.com/miankhalid","followers_url":"https://api.github.com/users/miankhalid/followers","following_url":"https://api.github.com/users/miankhalid/following{/other_user}","gists_url":"https://api.github.com/users/miankhalid/gists{/gist_id}","starred_url":"https://api.github.com/users/miankhalid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miankhalid/subscriptions","organizations_url":"https://api.github.com/users/miankhalid/orgs","repos_url":"https://api.github.com/users/miankhalid/repos","events_url":"https://api.github.com/users/miankhalid/events{/privacy}","received_events_url":"https://api.github.com/users/miankhalid/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":2,"state":"open","created_at":"2015-12-23T10:09:19Z","updated_at":"2016-05-17T14:42:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/edx/edx-app-android/pulls/709/commits","review_comments_url":"https://api.github.com/repos/edx/edx-app-android/pulls/709/comments","review_comment_url":"https://api.github.com/repos/edx/edx-app-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-app-android/issues/709/comments","statuses_url":"https://api.github.com/repos/edx/edx-app-android/statuses/e529d1bf23579255b9c0cf37d62c853869104e16","head":{"label":"edx:khalid/MA-2283","ref":"khalid/MA-2283","sha":"e529d1bf23579255b9c0cf37d62c853869104e16","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":29251742,"name":"edx-app-android","full_name":"edx/edx-app-android","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-app-android","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-app-android","forks_url":"https://api.github.com/repos/edx/edx-app-android/forks","keys_url":"https://api.github.com/repos/edx/edx-app-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-app-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-app-android/teams","hooks_url":"https://api.github.com/repos/edx/edx-app-android/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-app-android/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-app-android/events","assignees_url":"https://api.github.com/repos/edx/edx-app-android/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-app-android/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-app-android/tags","blobs_url":"https://api.github.com/repos/edx/edx-app-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-app-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-app-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-app-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-app-android/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-app-android/languages","stargazers_url":"https://api.github.com/repos/edx/edx-app-android/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-app-android/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-app-android/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-app-android/subscription","commits_url":"https://api.github.com/repos/edx/edx-app-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-app-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-app-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-app-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-app-android/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-app-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-app-android/merges","archive_url":"https://api.github.com/repos/edx/edx-app-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-app-android/downloads","issues_url":"https://api.github.com/repos/edx/edx-app-android/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-app-android/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-app-android/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-app-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-app-android/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-app-android/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-app-android/deployments","created_at":"2015-01-14T15:49:47Z","updated_at":"2016-05-20T11:32:08Z","pushed_at":"2016-06-07T11:06:44Z","git_url":"git://github.com/edx/edx-app-android.git","ssh_url":"git@github.com:edx/edx-app-android.git","clone_url":"https://github.com/edx/edx-app-android.git","svn_url":"https://github.com/edx/edx-app-android","homepage":null,"size":22653,"stargazers_count":78,"watchers_count":78,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":93,"mirror_url":null,"open_issues_count":6,"forks":93,"open_issues":6,"watchers":78,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"6436af3932cd6403bfc171d57755928252c04005","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":29251742,"name":"edx-app-android","full_name":"edx/edx-app-android","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-app-android","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-app-android","forks_url":"https://api.github.com/repos/edx/edx-app-android/forks","keys_url":"https://api.github.com/repos/edx/edx-app-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-app-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-app-android/teams","hooks_url":"https://api.github.com/repos/edx/edx-app-android/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-app-android/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-app-android/events","assignees_url":"https://api.github.com/repos/edx/edx-app-android/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-app-android/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-app-android/tags","blobs_url":"https://api.github.com/repos/edx/edx-app-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-app-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-app-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-app-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-app-android/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-app-android/languages","stargazers_url":"https://api.github.com/repos/edx/edx-app-android/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-app-android/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-app-android/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-app-android/subscription","commits_url":"https://api.github.com/repos/edx/edx-app-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-app-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-app-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-app-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-app-android/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-app-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-app-android/merges","archive_url":"https://api.github.com/repos/edx/edx-app-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-app-android/downloads","issues_url":"https://api.github.com/repos/edx/edx-app-android/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-app-android/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-app-android/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-app-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-app-android/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-app-android/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-app-android/deployments","created_at":"2015-01-14T15:49:47Z","updated_at":"2016-05-20T11:32:08Z","pushed_at":"2016-06-07T11:06:44Z","git_url":"git://github.com/edx/edx-app-android.git","ssh_url":"git@github.com:edx/edx-app-android.git","clone_url":"https://github.com/edx/edx-app-android.git","svn_url":"https://github.com/edx/edx-app-android","homepage":null,"size":22653,"stargazers_count":78,"watchers_count":78,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":93,"mirror_url":null,"open_issues_count":6,"forks":93,"open_issues":6,"watchers":78,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/709"},"html":{"href":"https://github.com/edx/edx-app-android/pull/709"},"issue":{"href":"https://api.github.com/repos/edx/edx-app-android/issues/709"},"comments":{"href":"https://api.github.com/repos/edx/edx-app-android/issues/709/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/709/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/709/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-app-android/statuses/e529d1bf23579255b9c0cf37d62c853869104e16"}}}}
{"actor":{"display_login":"1zaman"}}