mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 01:19:49 +00:00
AbstractHafasMobileProvider: Handle JSON API error LOCATION 'HCI Service: location missing or invalid'.
This commit is contained in:
parent
23b3bd7f6f
commit
0a6bc994fc
2 changed files with 3 additions and 1 deletions
|
@ -441,6 +441,8 @@ public abstract class AbstractHafasMobileProvider extends AbstractHafasProvider
|
|||
return new QueryTripsResult(header, QueryTripsResult.Status.TOO_CLOSE);
|
||||
if ("FAIL".equals(err) && "HCI Service: request failed".equals(errTxt))
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.SERVICE_DOWN);
|
||||
if ("LOCATION".equals(err) && "HCI Service: location missing or invalid".equals(errTxt))
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.UNKNOWN_LOCATION);
|
||||
throw new RuntimeException(err + " " + errTxt);
|
||||
}
|
||||
final JSONObject res = svcRes.getJSONObject("res");
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.google.common.base.MoreObjects.ToStringHelper;
|
|||
@SuppressWarnings("serial")
|
||||
public final class QueryTripsResult implements Serializable {
|
||||
public enum Status {
|
||||
OK, AMBIGUOUS, TOO_CLOSE, UNKNOWN_FROM, UNKNOWN_VIA, UNKNOWN_TO, UNRESOLVABLE_ADDRESS, NO_TRIPS, INVALID_DATE, SERVICE_DOWN;
|
||||
OK, AMBIGUOUS, TOO_CLOSE, UNKNOWN_FROM, UNKNOWN_VIA, UNKNOWN_TO, UNKNOWN_LOCATION, UNRESOLVABLE_ADDRESS, NO_TRIPS, INVALID_DATE, SERVICE_DOWN;
|
||||
}
|
||||
|
||||
public final @Nullable ResultHeader header;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue