mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-08 09:28:48 +00:00
AbstractHafasMobileProvider: Handle 'HCI Service: request failed' error in jsonLocGeoPos() and jsonLocMatch().
This commit is contained in:
parent
2c8e5ba9ec
commit
b1624f6b0a
1 changed files with 6 additions and 0 deletions
|
@ -183,6 +183,9 @@ public abstract class AbstractHafasMobileProvider extends AbstractHafasProvider
|
|||
final String err = svcRes.getString("err");
|
||||
if (!"OK".equals(err)) {
|
||||
final String errTxt = svcRes.getString("errTxt");
|
||||
log.debug("Hafas error: {} {}", err, errTxt);
|
||||
if ("FAIL".equals(err) && "HCI Service: request failed".equals(errTxt))
|
||||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||
throw new RuntimeException(err + " " + errTxt);
|
||||
}
|
||||
final JSONObject res = svcRes.getJSONObject("res");
|
||||
|
@ -356,6 +359,9 @@ public abstract class AbstractHafasMobileProvider extends AbstractHafasProvider
|
|||
final String err = svcRes.getString("err");
|
||||
if (!"OK".equals(err)) {
|
||||
final String errTxt = svcRes.getString("errTxt");
|
||||
log.debug("Hafas error: {} {}", err, errTxt);
|
||||
if ("FAIL".equals(err) && "HCI Service: request failed".equals(errTxt))
|
||||
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