]> www.average.org Git - WhereAmI.git/blobdiff - src/org/average/whereami/LastLocation.java
Network access error message
[WhereAmI.git] / src / org / average / whereami / LastLocation.java
index c5791160298ab42ece4bf5f4950b100561938a6c..27c5c51f8f4909e0b7fdc2c7a925270c0897b9c2 100644 (file)
@@ -8,6 +8,8 @@ import org.average.whereami.SayWhen;
 
 import java.lang.Math;
 import java.io.IOException;
 
 import java.lang.Math;
 import java.io.IOException;
+import java.net.UnknownHostException;
+import org.apache.http.conn.HttpHostConnectException;
 
 import com.google.api.client.googleapis.json.GoogleJsonResponseException;
 import com.google.api.client.http.HttpResponseException;
 
 import com.google.api.client.googleapis.json.GoogleJsonResponseException;
 import com.google.api.client.http.HttpResponseException;
@@ -77,6 +79,16 @@ public final class LastLocation extends Oracle {
                 } catch (HttpResponseException e) {
                        Log.e(TAG, "HttpResponseException: " + e);
                        return new Utterance(false, e.getMessage());
                 } catch (HttpResponseException e) {
                        Log.e(TAG, "HttpResponseException: " + e);
                        return new Utterance(false, e.getMessage());
+               } catch (UnknownHostException e) {
+                       Log.e(TAG, "UnknownHostException: " + e);
+                       return new Utterance(false,
+                                       base.connectErrorMessage + "\n" +
+                                       e.getMessage());
+               } catch (HttpHostConnectException e) {
+                       Log.e(TAG, "HttpHostConnectException: " + e);
+                       return new Utterance(false,
+                                       base.connectErrorMessage + "\n" +
+                                       e.getMessage());
                } catch (IOException e) {
                        Log.e(TAG, "IOException: " + e);
                        return new Utterance(false, e.getMessage());
                } catch (IOException e) {
                        Log.e(TAG, "IOException: " + e);
                        return new Utterance(false, e.getMessage());