From 02c374b61e9ecf8cfb365bfd590edcba75f4492b Mon Sep 17 00:00:00 2001 From: Matthew Simmons Date: Tue, 8 Feb 2011 17:23:39 -0500 Subject: [PATCH] Map Fusion Tables uploading failures to the HTTP Exception that GData expects. Fix typo in proguard disabling comment. --- MyTracks/default.properties | 2 +- .../android/apps/mytracks/io/SendToFusionTables.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/MyTracks/default.properties b/MyTracks/default.properties index a041b4484..019a98ced 100644 --- a/MyTracks/default.properties +++ b/MyTracks/default.properties @@ -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 diff --git a/MyTracks/src/com/google/android/apps/mytracks/io/SendToFusionTables.java b/MyTracks/src/com/google/android/apps/mytracks/io/SendToFusionTables.java index 9d08dd3b9..949d95811 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/io/SendToFusionTables.java +++ b/MyTracks/src/com/google/android/apps/mytracks/io/SendToFusionTables.java @@ -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];