mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 23:28:48 +00:00
AbstractHafasClientInterfaceProvider: Handle CGI_NO_SERVER error for all queries.
This commit is contained in:
parent
00e0074dc5
commit
e2dafd2874
1 changed files with 8 additions and 0 deletions
|
@ -256,6 +256,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_READ_FAILED".equals(err))
|
||||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_NO_SERVER".equals(err))
|
||||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||
throw new RuntimeException(err + " " + errTxt);
|
||||
}
|
||||
final JSONObject res = svcRes.getJSONObject("res");
|
||||
|
@ -331,6 +333,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_READ_FAILED".equals(err))
|
||||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_NO_SERVER".equals(err))
|
||||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN);
|
||||
throw new RuntimeException(err + " " + errTxt);
|
||||
}
|
||||
final JSONObject res = svcRes.getJSONObject("res");
|
||||
|
@ -460,6 +464,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_READ_FAILED".equals(err))
|
||||
return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_NO_SERVER".equals(err))
|
||||
return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN);
|
||||
throw new RuntimeException(err + " " + errTxt);
|
||||
}
|
||||
final JSONObject res = svcRes.getJSONObject("res");
|
||||
|
@ -596,6 +602,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
return new QueryTripsResult(header, QueryTripsResult.Status.UNKNOWN_LOCATION);
|
||||
if ("CGI_READ_FAILED".equals(err))
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_NO_SERVER".equals(err))
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN);
|
||||
throw new RuntimeException(err + " " + errTxt);
|
||||
}
|
||||
final JSONObject res = svcRes.getJSONObject("res");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue