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

Error message on backend "resrobot.se" station departures search #267

Open
mikwebdev opened this issue Feb 3, 2018 · 6 comments
Open

Error message on backend "resrobot.se" station departures search #267

mikwebdev opened this issue Feb 3, 2018 · 6 comments

Comments

@mikwebdev
Copy link

mikwebdev commented Feb 3, 2018

[Affected versions]:

  • 2.0.31

[Affected platforms]:

  • Nokia N9 Meego Harmattan

[Steps to reproduce]:

  1. Select backend "resrobot.se".
  2. Open station departures tab.
  3. Choose station. For example, "Lund Centralstation".
  4. Choose direction. For example, "Lund Lundagård".
  5. Click "Show departures" button.

[Expected result]:

  • A list of departures is shown with time, train number and destination.

[Actual result]:

  • Error message shown: "Cannot parse reply from the server".

[Notes]:

  • Issue is not reproducible when direction station is valid from backend server. For example, station "Lund Centralstation" and direction "Lund Univ-sjukhuset" will work.
  • Attached a screenshot of the issue.

2018-01-26_18-03-14

@f03el
Copy link

f03el commented Dec 10, 2018

@mikwebdev Thank you for reporting this. I'll have a look at it ASAP.

@mikwebdev
Copy link
Author

@f03el Thank you. Much appreciated as I still use Fahrplan on my Nokia N9 regularly.

@f03el
Copy link

f03el commented Dec 11, 2018

The reply from the server is just an empty JSON object (i.e. {}) when the direction station is not part of any route from the departure station. Would it make more sense to just show an empty result list instead of the error message?

@mikwebdev
Copy link
Author

mikwebdev commented Dec 11, 2018

Yes, an empty result list is much better than an loading squircle and error message.

With constant loading squircle and error message it gives the impression that something is technically wrong. Maybe change error message to something like "No departures found." or "No results found." and stop the loading squircle?

I have attached an error message from rejseplanen.dk. Maybe do something similar?

For example:
Sweden (resrobot.se) replied:
"No departures found to that direction."
or
Sweden (resrobot.se) replied:
"No results found."

2018-12-11_22-12-40

@f03el
Copy link

f03el commented Dec 11, 2018

OK, I think an empty result list is the only possible solution in this case. There is no way we can know whether the reply is empty just because there simply are no departures from that station at the time, or because the user has selected a "bad" combination of station and direction. If you want to test a bus stop with no departures, try "Granträskvägen (Lycksele kn)" in the weekend. :)

The backend only has the options to either return a list of departures (special case: empty list), or throw an exception, which shows an error message (in the N9 case with a loading circle). The loading circle is nothing the backend controls. On Sailfish OS there is no indicator or similar in this case. It just shows the error message.

@mikwebdev
Copy link
Author

Ok, I understand. I'm fine with an empty list, as long as loading squircle and error message doesn't show.

f03el pushed a commit to f03el/fahrplan that referenced this issue Dec 13, 2018
Sometimes, the server reply can be empty and still valid. This is for
example the case with time table replies when there are no departures
from a station (or at least not any departures matching the selected
direction).

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

No branches or pull requests

2 participants