Pebble: do not display a toast when watchapp configuration could not be found during initialization of appmessage handler

Unfortunately all users without TimeStyle installed got an error in Gadgetbridge 0.17.2
here
Andreas Shimokawa 2017-01-24 23:12:36 +01:00
parent 4f45ad660d
commit 25433ef6bc
5 changed files with 15 additions and 10 deletions

View File

@ -28,8 +28,9 @@ class AppMessageHandlerHealthify extends AppMessageHandler {
JSONObject appKeys = getAppKeys();
KEY_TEMPERATURE = appKeys.getInt("TEMPERATURE");
KEY_CONDITIONS = appKeys.getInt("CONDITIONS");
} catch (IOException | JSONException e) {
GB.toast("There was an error accessing the watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (JSONException e) {
GB.toast("There was an error accessing the Helthify watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (IOException ignore) {
}
}

View File

@ -71,8 +71,9 @@ class AppMessageHandlerMorpheuz extends AppMessageHandler {
keyAutoReset = appKeys.getInt("keyAutoReset");
keySnoozes = appKeys.getInt("keySnoozes");
keyFault = appKeys.getInt("keyFault");
} catch (IOException | JSONException e) {
GB.toast("There was an error accessing the watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (JSONException e) {
GB.toast("There was an error accessing the morpheuz watchapp configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (IOException ignore) {
}
}

View File

@ -34,8 +34,9 @@ class AppMessageHandlerSquare extends AppMessageHandler {
CfgKeyWeatherMode = appKeys.getInt("CfgKeyWeatherMode");
CfgKeyUseCelsius = appKeys.getInt("CfgKeyUseCelsius");
CfgKeyWeatherLocation = appKeys.getInt("CfgKeyWeatherLocation");
} catch (IOException | JSONException e) {
GB.toast("There was an error accessing the watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (JSONException e) {
GB.toast("There was an error accessing the Square watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (IOException ignore) {
}
}

View File

@ -53,8 +53,9 @@ class AppMessageHandlerTimeStylePebble extends AppMessageHandler {
break;
}
}
} catch (IOException | JSONException e) {
GB.toast("There was an error accessing the watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (JSONException e) {
GB.toast("There was an error accessing the timestyle watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (IOException ignore) {
}
}

View File

@ -35,8 +35,9 @@ class AppMessageHandlerTrekVolle extends AppMessageHandler {
MESSAGE_KEY_WEATHER_TEMPERATURE_MIN = appKeys.getInt("WEATHER_TEMPERATURE_MIN");
MESSAGE_KEY_WEATHER_TEMPERATURE_MAX = appKeys.getInt("WEATHER_TEMPERATURE_MAX");
MESSAGE_KEY_WEATHER_LOCATION = appKeys.getInt("WEATHER_LOCATION");
} catch (IOException | JSONException e) {
GB.toast("There was an error accessing the watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (JSONException e) {
GB.toast("There was an error accessing the TrekVolle watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
} catch (IOException ignore) {
}
}