mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 16:20:34 +00:00
AbstractHafasClientInterfaceProvider: Handle H_UNKNOWN error for all queries.
This commit is contained in:
parent
330fccb61b
commit
0f6862f87a
1 changed files with 8 additions and 0 deletions
|
@ -265,6 +265,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
||||||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||||
if ("CGI_NO_SERVER".equals(err))
|
if ("CGI_NO_SERVER".equals(err))
|
||||||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
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);
|
throw new RuntimeException(err + " " + errTxt);
|
||||||
}
|
}
|
||||||
final JSONObject res = svcRes.getJSONObject("res");
|
final JSONObject res = svcRes.getJSONObject("res");
|
||||||
|
@ -352,6 +354,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
||||||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN);
|
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN);
|
||||||
if ("CGI_NO_SERVER".equals(err))
|
if ("CGI_NO_SERVER".equals(err))
|
||||||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN);
|
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);
|
throw new RuntimeException(err + " " + errTxt);
|
||||||
}
|
}
|
||||||
final JSONObject res = svcRes.getJSONObject("res");
|
final JSONObject res = svcRes.getJSONObject("res");
|
||||||
|
@ -487,6 +491,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
||||||
return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN);
|
return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN);
|
||||||
if ("CGI_NO_SERVER".equals(err))
|
if ("CGI_NO_SERVER".equals(err))
|
||||||
return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN);
|
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);
|
throw new RuntimeException(err + " " + errTxt);
|
||||||
}
|
}
|
||||||
final JSONObject res = svcRes.getJSONObject("res");
|
final JSONObject res = svcRes.getJSONObject("res");
|
||||||
|
@ -627,6 +633,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
||||||
return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN);
|
return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN);
|
||||||
if ("CGI_NO_SERVER".equals(err))
|
if ("CGI_NO_SERVER".equals(err))
|
||||||
return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN);
|
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);
|
throw new RuntimeException(err + " " + errTxt);
|
||||||
}
|
}
|
||||||
final JSONObject res = svcRes.getJSONObject("res");
|
final JSONObject res = svcRes.getJSONObject("res");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue