mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-07 21:58:48 +00:00
NearestFavoriteStationWidgetService: Add dedicated message for SSLException.
This commit is contained in:
parent
5bcb6a1ea6
commit
817692e533
3 changed files with 11 additions and 0 deletions
|
@ -163,6 +163,7 @@
|
||||||
<string name="nearest_favorite_station_widget_lastupdated">aktualisiert %s</string>
|
<string name="nearest_favorite_station_widget_lastupdated">aktualisiert %s</string>
|
||||||
<string name="nearest_favorite_station_widget_error_connect">Server-Verbindung nicht möglich.\n\nTapp um es nochmal zu probieren.\n\nWenn das Problem bestehen bleibt, überprüfe ob Hintergrunddaten eingeschränkt sind.</string>
|
<string name="nearest_favorite_station_widget_error_connect">Server-Verbindung nicht möglich.\n\nTapp um es nochmal zu probieren.\n\nWenn das Problem bestehen bleibt, überprüfe ob Hintergrunddaten eingeschränkt sind.</string>
|
||||||
<string name="nearest_favorite_station_widget_error_blocked">Die Abfrage wurde von \"%s\" blockiert - möglicherweise wegen Serverüberlastung.\n\nTapp um es nochmal zu probieren.</string>
|
<string name="nearest_favorite_station_widget_error_blocked">Die Abfrage wurde von \"%s\" blockiert - möglicherweise wegen Serverüberlastung.\n\nTapp um es nochmal zu probieren.</string>
|
||||||
|
<string name="nearest_favorite_station_widget_error_ssl">Die Sicherheits-Konfiguration des Servers ist fehlerhaft: %s</string>
|
||||||
<string name="nearest_favorite_station_widget_error_exception">Aua!\n\n%s\n\nTapp um es nochmal zu probieren.</string>
|
<string name="nearest_favorite_station_widget_error_exception">Aua!\n\n%s\n\nTapp um es nochmal zu probieren.</string>
|
||||||
|
|
||||||
<!-- directions -->
|
<!-- directions -->
|
||||||
|
|
|
@ -164,6 +164,7 @@
|
||||||
<string name="nearest_favorite_station_widget_lastupdated">updated %s</string>
|
<string name="nearest_favorite_station_widget_lastupdated">updated %s</string>
|
||||||
<string name="nearest_favorite_station_widget_error_connect">Could not connect to server.\n\nTap to try again.\n\nIf the problem persists, check if background data is restricted.</string>
|
<string name="nearest_favorite_station_widget_error_connect">Could not connect to server.\n\nTap to try again.\n\nIf the problem persists, check if background data is restricted.</string>
|
||||||
<string name="nearest_favorite_station_widget_error_blocked">The query has been blocked by \"%s\", possibly because of server overload.\n\nTap to try again.</string>
|
<string name="nearest_favorite_station_widget_error_blocked">The query has been blocked by \"%s\", possibly because of server overload.\n\nTap to try again.</string>
|
||||||
|
<string name="nearest_favorite_station_widget_error_ssl">The security configuration of the server is faulty: %s</string>
|
||||||
<string name="nearest_favorite_station_widget_error_exception">Ouch!\n\n%s\n\nTap to try again.</string>
|
<string name="nearest_favorite_station_widget_error_exception">Ouch!\n\n%s\n\nTap to try again.</string>
|
||||||
|
|
||||||
<!-- directions -->
|
<!-- directions -->
|
||||||
|
|
|
@ -27,9 +27,12 @@ import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLException;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.google.common.base.Throwables;
|
||||||
import com.google.common.util.concurrent.SettableFuture;
|
import com.google.common.util.concurrent.SettableFuture;
|
||||||
|
|
||||||
import de.schildbach.oeffi.Constants;
|
import de.schildbach.oeffi.Constants;
|
||||||
|
@ -280,6 +283,12 @@ public class NearestFavoriteStationWidgetService extends JobIntentService {
|
||||||
getString(R.string.nearest_favorite_station_widget_error_blocked, x.getUrl().host()));
|
getString(R.string.nearest_favorite_station_widget_error_blocked, x.getUrl().host()));
|
||||||
appWidgetManager.updateAppWidget(appWidgetId, views);
|
appWidgetManager.updateAppWidget(appWidgetId, views);
|
||||||
log.info("Could not query departures for station " + stationId, x);
|
log.info("Could not query departures for station " + stationId, x);
|
||||||
|
} catch (final SSLException x) {
|
||||||
|
setHeader(appWidgetId, favorite.name);
|
||||||
|
setMessage(getString(R.string.nearest_favorite_station_widget_error_ssl,
|
||||||
|
Throwables.getRootCause(x).getClass().getSimpleName()));
|
||||||
|
appWidgetManager.updateAppWidget(appWidgetId, views);
|
||||||
|
log.info("Could not query departures for station " + stationId, x);
|
||||||
} catch (final Exception x) {
|
} catch (final Exception x) {
|
||||||
setHeader(appWidgetId, favorite.name);
|
setHeader(appWidgetId, favorite.name);
|
||||||
setMessage(getString(R.string.nearest_favorite_station_widget_error_exception, x.toString()));
|
setMessage(getString(R.string.nearest_favorite_station_widget_error_exception, x.toString()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue