Closed schildbach closed 9 years ago
This should not even happen, as the pte API does not support bike sharing system option... I can add the missing enums values to SectionType, but AbstractNavitiaProvider.parseLeg will still throw IllegalArgumentException if I don't handle new types such as BSS_RENT.
@schildbach do you consider this to be a suitable fix for now? We could always add bss support in pte later.
Generally I like seeing exceptions if something is wrong. If the API returns something it should not return, it's an API bug and should be reported with Navitia I'd say. If they fix it, all is well. Only if they don't manage to fix it I would add code to ignore BSS_RENT values. For now, it seems to happen very rarely, so don't worry.
Agreed.
Fixed in 92705c3ab17398e1b56419b0f1fd57d7b61a847d.
When I was running ParisProviderLiveTest today, I got this:
java.lang.IllegalArgumentException: No enum constant de.schildbach.pte.AbstractNavitiaProvider.SectionType.BSS_RENT at java.lang.Enum.valueOf(Enum.java:238) at de.schildbach.pte.AbstractNavitiaProvider$SectionType.valueOf(AbstractNavitiaProvider.java:1) at de.schildbach.pte.AbstractNavitiaProvider.parseLeg(AbstractNavitiaProvider.java:459) at de.schildbach.pte.AbstractNavitiaProvider.parseQueryTripsResult(AbstractNavitiaProvider.java:571) at de.schildbach.pte.AbstractNavitiaProvider.queryTrips(AbstractNavitiaProvider.java:1107) at de.schildbach.pte.live.AbstractProviderLiveTest.queryTrips(AbstractProviderLiveTest.java:135) at de.schildbach.pte.live.ParisProviderLiveTest.queryTripSlowWalk(ParisProviderLiveTest.java:252)