smurfy / fahrplan

QT Application for Public transportation
GNU General Public License v2.0
58 stars 33 forks source link

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

Open mikwebdev opened 6 years ago

mikwebdev commented 6 years ago

[Affected versions]:

[Affected platforms]:

[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]:

[Actual result]:

[Notes]:

2018-01-26_18-03-14

f03el commented 5 years ago

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

mikwebdev commented 5 years ago

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

f03el commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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