{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/782","labels_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/782/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/782/comments","events_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/782/events","html_url":"https://github.com/chrsmith/google-api-java-client/issues/782","id":59528194,"number":782,"title":"Http errors on executeMediaAndDownloadTo fail to throw GoogleJsonResponseException","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Component-HTTP","name":"Component-HTTP","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-02T18:58:32Z","updated_at":"2015-03-02T18:58:34Z","closed_at":null,"body":"```\nVersion of google-api-java-client (e.g. 1.15.0-rc)?\n\n@head as of 20130516\n\nJava environment (e.g. Java 6, Android 2.3, App Engine)?\n\nJava7\n\nDescribe the problem.\n\nHttp errors (such as 404) during \"get\" requests which use the \nexecuteMediaAndDownloadTo method fail to throw the expected \nGoogleJsonResponseException, instead throwing a plain HttpResponseException. \nFor example,\n\ntry {\n  gcs.objects().get(\"nonexistent-foo\", \"nonexistent-bar\").executeMediaAndDownloadTo(out);\n} catch (GoogleJsonResponseException e) {\n  // Expected.\n  assertEquals(404, e.getStatusCode())\n}\n\nwill fail to catch any exception, instead leaking a plain HttpResponseException \nwith status code 404.\n\nRelated methods, such as execute() and executeMedia() both correctly throw \nGoogleJsonResponseException.\n\n\nHow would you expect it to be fixed?\n\nThe HttpMediaDownloader should include logic similar to the enclosing \nAbstractGoogleClientRequest.buildHttpRequest, which sets up an \nHttpResponseInterceptor to allow throwing custom exceptions.\n```\n\nOriginal issue reported on code.google.com by `d...@google.com` on 16 May 2013 at 9:31"},"comment":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/comments/76781217","html_url":"https://github.com/chrsmith/google-api-java-client/issues/782#issuecomment-76781217","issue_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/782","id":76781217,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T18:58:33Z","updated_at":"2015-03-02T18:58:33Z","body":"\n\nOriginal comment by `pele...@google.com` on 29 Jul 2013 at 6:07\n* Added labels: **Milestone-Version1.18.0**\n* Removed labels: **Milestone-Version1.17.0**"}}