{"action":"opened","issue":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/772","labels_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/772/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/772/comments","events_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/772/events","html_url":"https://github.com/chrsmith/google-api-java-client/issues/772","id":59382632,"number":772,"title":"MediaHttpUploader.serverErrorCallback() does not work if data has been partially or fully uploaded","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-Media","name":"Component-Media","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Milestone-Version1.16.0","name":"Milestone-Version1.16.0","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-Enhancement","name":"Type-Enhancement","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-01T06:02:26Z","updated_at":"2015-03-01T06:02:26Z","closed_at":null,"body":"```\nVersion of google-api-java-client (e.g. 1.5.0-beta)?\n\n1.14.1-beta\n\nJava environment (e.g. Java 6, Android 2.3, App Engine)?\n\nAll\n\nDescribe the problem.\n\nSee:\nhttp://javadoc.google-api-java-client.googlecode.com/hg/1.14.1-beta/com/google/a\npi/client/googleapis/media/MediaHttpUploader.html#serverErrorCallback()\n\nI added a test in \nMediaHttpUploaderTest.testUpload_ResumableIOExceptionWithIOExceptionHandler to \ndemonstrate what happens if data has been partially or fully uploaded despite \nthe I/O exception.\n\nI can actually reproduce this running against the production server.  I \nmodified the drive-cmdline-sample by adding an HttpRequestInitializer that sets \nrequest.setReadTimeout(100) on the first upload call.  It actually uploads the \nwhole thing, but it still times out and throws an I/O exception.  It then \neither throws an IllegalArgumentException or IllegalStateException depending on \nwhether we know the content length.\n\nWhile you are at it, we also need to deal with the possibility of the server \nerror callback returning an OK response with the JSON metadata.  At least the \ndocumentation claims it is possible, but we should try to verify by testing it \nagainst the production server.\n\nHow would you expect it to be fixed?\n\nThis is potentially non-trivial because we also need to be sensitive to the \nchunk size.  My understanding is that the Google server requires the chunk size \nto be a certain multiple of 256KB.  Alternatively, we may want to respect the \nchunk size that the developer requested.  There is also the case of fully \nuploaded, in which case we need to just continue with the next chunk entirely.\n```\n\nOriginal issue reported on code.google.com by `yan...@google.com` on 23 Apr 2013 at 2:58"}}