mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
Hafas: Handle JSON API error H9380 'Departure/Arrival/Intermediate or equivalent stations def'd more than once'.
This commit is contained in:
parent
b3965275fb
commit
907fc38dc4
2 changed files with 10 additions and 0 deletions
|
@ -1197,6 +1197,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return new QueryTripsResult(header, QueryTripsResult.Status.UNRESOLVABLE_ADDRESS);
|
||||
if ("H9360".equals(err)) // Date outside of the timetable period.
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.INVALID_DATE);
|
||||
if ("H9380".equals(err)) // Departure/Arrival/Intermediate or equivalent stations def'd more than once.
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.TOO_CLOSE);
|
||||
final String errTxt = svcRes.getString("errTxt");
|
||||
throw new RuntimeException(err + ": " + errTxt);
|
||||
}
|
||||
|
|
|
@ -123,4 +123,12 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest
|
|||
new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void trip_errorTooClose() throws Exception
|
||||
{
|
||||
final Location station = new Location(LocationType.STATION, "003665026");
|
||||
final QueryTripsResult result = queryTrips(station, null, station, new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
assertEquals(QueryTripsResult.Status.TOO_CLOSE, result.status);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue