Map Fusion Tables uploading failures to the HTTP Exception that GData expects.

Fix typo in proguard disabling comment.
This commit is contained in:
Matthew Simmons
2011-02-08 17:23:39 -05:00
parent f2094e049a
commit 02c374b61e
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ split.density=false
target=Google Inc.:Google APIs:9
android.library.reference.1=../MyTracksLib/
# ProGuard is turned off while we investigate the the removal of code that
# ProGuard is turned off while we investigate the removal of code that
# isn't actually dead from Fusion Tables. See issue 303 for an example of
# the result of that removal.
#proguard.config=proguard.cfg
@@ -34,6 +34,7 @@ import com.google.api.client.googleapis.MethodOverrideIntercepter;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpResponseException;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.InputStreamContent;
import com.google.api.client.javanet.NetHttpTransport;
@@ -665,7 +666,12 @@ public class SendToFusionTables implements Runnable {
request.content = isc;
Log.d(MyTracksConstants.TAG, "Running update query " + url.toString() + ": " + sql);
HttpResponse response = request.execute();
HttpResponse response = null;
try {
response = request.execute();
} catch (HttpResponseException e) {
throw new GDataWrapper.HttpException(e.response.statusCode, e.getMessage());
}
boolean success = response.isSuccessStatusCode;
if (success) {
byte[] result = new byte[1024];