From 0f6862f87a278b98eabface9942eb73f802c56b3 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Mon, 28 Oct 2019 13:51:45 +0100 Subject: [PATCH] AbstractHafasClientInterfaceProvider: Handle H_UNKNOWN error for all queries. --- .../pte/AbstractHafasClientInterfaceProvider.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java b/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java index 6f2128a3..6f9c1fa4 100644 --- a/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java +++ b/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java @@ -265,6 +265,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN); if ("CGI_NO_SERVER".equals(err)) return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN); + if ("H_UNKNOWN".equals(err)) + return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN); throw new RuntimeException(err + " " + errTxt); } final JSONObject res = svcRes.getJSONObject("res"); @@ -352,6 +354,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN); if ("CGI_NO_SERVER".equals(err)) return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN); + if ("H_UNKNOWN".equals(err)) + return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN); throw new RuntimeException(err + " " + errTxt); } final JSONObject res = svcRes.getJSONObject("res"); @@ -487,6 +491,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN); if ("CGI_NO_SERVER".equals(err)) return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN); + if ("H_UNKNOWN".equals(err)) + return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN); throw new RuntimeException(err + " " + errTxt); } final JSONObject res = svcRes.getJSONObject("res"); @@ -627,6 +633,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN); if ("CGI_NO_SERVER".equals(err)) return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN); + if ("H_UNKNOWN".equals(err)) + return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN); throw new RuntimeException(err + " " + errTxt); } final JSONObject res = svcRes.getJSONObject("res");