Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should No results give an error? #347

Open
ChristopheVersieux opened this issue May 25, 2018 · 1 comment
Open

Should No results give an error? #347

ChristopheVersieux opened this issue May 25, 2018 · 1 comment
Labels

Comments

@ChristopheVersieux
Copy link
Member

Hello

When looking at some connections, I noticed that depending on the time, it might be no trains, meaning no results:

https://api.irail.be/connections.php?to=Aalst-Kerrebroek&from=Mons&date=250518&time=2115&timeSel=depart&lang=en&typeOfTransport=train&format=json&fast=true&alerts=true

But it's that really an error?

Shouldn't be logical to get an empty array?

In fact that's an open question rather than an issue...

@Bertware
Copy link
Member

Bertware commented May 25, 2018

I'll take a look into the exact implementation of this, it might be that NMBS returns a 404 to us, and we echo it, or else it's just us who return a 404 to indicate we couldn't find results (in which cases a 404 is an easy way for clients to catch this edge-case).

I know we're doing this for trains when they can't be found, even if they might drive on other days, so in that way its consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants