mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-08 10:58:48 +00:00
AbstractHafasClientInterfaceProvider: Handle CGI_READ_FAILED error in all queries.
This commit is contained in:
parent
21fbce08f7
commit
a199d757d2
1 changed files with 6 additions and 0 deletions
|
@ -209,6 +209,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
log.debug("Hafas error: {} {}", err, errTxt);
|
||||
if ("FAIL".equals(err) && "HCI Service: request failed".equals(errTxt))
|
||||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_READ_FAILED".equals(err))
|
||||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||
throw new RuntimeException(err + " " + errTxt);
|
||||
}
|
||||
final JSONObject res = svcRes.getJSONObject("res");
|
||||
|
@ -279,6 +281,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.INVALID_STATION);
|
||||
if ("FAIL".equals(err) && "HCI Service: request failed".equals(errTxt))
|
||||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_READ_FAILED".equals(err))
|
||||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.SERVICE_DOWN);
|
||||
throw new RuntimeException(err + " " + errTxt);
|
||||
}
|
||||
final JSONObject res = svcRes.getJSONObject("res");
|
||||
|
@ -395,6 +399,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
log.debug("Hafas error: {} {}", err, errTxt);
|
||||
if ("FAIL".equals(err) && "HCI Service: request failed".equals(errTxt))
|
||||
return new SuggestLocationsResult(header, SuggestLocationsResult.Status.SERVICE_DOWN);
|
||||
if ("CGI_READ_FAILED".equals(err))
|
||||
return new SuggestLocationsResult(header, SuggestLocationsResult.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