- return locationMessage(lat, lon, tsm);
- } catch (Exception ex) {
- Log.v(TAG, "exception in getResult: " + ex);
- ex.printStackTrace();
- return ex.getMessage();
+ return new Utterance(true,
+ locationMessage(lat, lon, tsm));
+ } catch (GoogleJsonResponseException e) {
+ Log.e(TAG, "GoogleJsonResponseException: " + e);
+ if (e.getResponse().getStatusCode() == 401) {
+ return new Utterance(false,
+ base.authErrorMessage + "\n" +
+ e.getMessage());
+ } else {
+ 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());