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

Major disruption at Paddington causing crash #105

Open
jruys opened this issue Jul 26, 2023 · 6 comments
Open

Major disruption at Paddington causing crash #105

jruys opened this issue Jul 26, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@jruys
Copy link

jruys commented Jul 26, 2023

“Major disruption” at PAD today. That’s the station my board is showing and (I guess) somehow the software doesn't like what its getting from the API.

image
image

@jruys
Copy link
Author

jruys commented Jul 26, 2023

Update: 2 minutes later board started running again, all 3 entries showing “delayed” or “cancelled”.

@chrisys chrisys added the bug Something isn't working label Jul 26, 2023
@CalamityJames
Copy link
Contributor

I believe I have added a try block for this error, however as it doesn't happen that often there isn't much real world testing that can be done here!

I made a few changes to how the drawBlankSignage function works, allowing it to display that there has been an error parsing the data, if the newly added debug mode is enabled.
image

If debug isn't enabled, it falls back to the Out of Hours station name, as we can't fetch the actual station name as there has been an error getting data from the API.

I did originally show this error message at any time, but I would imagine real departure displays wouldn't be verbose unless there was a debugging mode enabled, so added an if for debug.

It also should log the error to the console too.

I did consider writing a routine to temporarily speed up the refreshTime if an error like this occurs, but that might be out of the scope of this bug so decided against it for now!

I haven't submitted this a pull request yet, but feel free to check out the changes on my branch: https://github.com/CalamityJames/train-departure-display/tree/handle-openldbws-error

Will wait for @chrisys input to submit a PR!

@metacurb
Copy link

Can I suggest that if we go down this route we put it behind a config? I'd much prefer my display to not update so that there's a more graceful degredation

@CalamityJames
Copy link
Contributor

That's a fair point, as it stands I think that by the point the loop has got here the old departure data will have been unset, I will try to have a play around this evening to see if there's anything that can be done

@CalamityJames
Copy link
Contributor

CalamityJames commented Jul 27, 2023

@BeauAgst I have added a variable that gets written to each time there is good data which can be used in the event of API failure.

I left the original error handling in, in case the display gets started and there is no good data at all

CalamityJames@e73754a

Obviously if there is an extended downtime this data just plain won't update until there is any more data, but I don't think there's an easy way to sanity check that.

I guess you could add an indicator in an unused part of the display to indicate it's not using live data, maybe just an asterisk on the clock line or something. Open to suggestions!

@chrisys
Copy link
Owner

chrisys commented Aug 21, 2023

I think I'm of the view here that if we have good data (even if outdated) we can show it, but like you say if we start the display and there's no good data at all it's good to show the error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants