mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 17:10:30 +00:00
AbstractHafasClientInterfaceProvider: 'errTxt' is always optional.
This commit is contained in:
parent
724f8a23e3
commit
21fbce08f7
1 changed files with 3 additions and 3 deletions
|
@ -205,7 +205,7 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
checkState("LocGeoPos".equals(svcRes.getString("meth")));
|
||||
final String err = svcRes.getString("err");
|
||||
if (!"OK".equals(err)) {
|
||||
final String errTxt = svcRes.getString("errTxt");
|
||||
final String errTxt = svcRes.optString("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);
|
||||
|
@ -273,7 +273,7 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
checkState("StationBoard".equals(svcRes.getString("meth")));
|
||||
final String err = svcRes.getString("err");
|
||||
if (!"OK".equals(err)) {
|
||||
final String errTxt = svcRes.getString("errTxt");
|
||||
final String errTxt = svcRes.optString("errTxt");
|
||||
log.debug("Hafas error: {} {}", err, errTxt);
|
||||
if ("LOCATION".equals(err) && "HCI Service: location missing or invalid".equals(errTxt))
|
||||
return new QueryDeparturesResult(header, QueryDeparturesResult.Status.INVALID_STATION);
|
||||
|
@ -391,7 +391,7 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
checkState("LocMatch".equals(svcRes.getString("meth")));
|
||||
final String err = svcRes.getString("err");
|
||||
if (!"OK".equals(err)) {
|
||||
final String errTxt = svcRes.getString("errTxt");
|
||||
final String errTxt = svcRes.optString("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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue