AbstractHafasClientInterfaceProvider: Handle CGI_READ_FAILED error in jsonTripSearch().

This commit is contained in:
Andreas Schildbach 2018-11-26 19:55:17 +01:00
parent b370effeae
commit 667166bbc9

View file

@ -514,6 +514,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN); return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN);
if ("LOCATION".equals(err) && "HCI Service: location missing or invalid".equals(errTxt)) if ("LOCATION".equals(err) && "HCI Service: location missing or invalid".equals(errTxt))
return new QueryTripsResult(header, QueryTripsResult.Status.UNKNOWN_LOCATION); return new QueryTripsResult(header, QueryTripsResult.Status.UNKNOWN_LOCATION);
if ("CGI_READ_FAILED".equals(err))
return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN);
throw new RuntimeException(err + (errTxt != null ? " " + errTxt : "")); throw new RuntimeException(err + (errTxt != null ? " " + errTxt : ""));
} }
final JSONObject res = svcRes.getJSONObject("res"); final JSONObject res = svcRes.getJSONObject("res");