Git Product home page Git Product logo

Comments (6)

jruys avatar jruys commented on June 26, 2024

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

from train-departure-display.

CalamityJames avatar CalamityJames commented on June 26, 2024

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!

from train-departure-display.

metacurb avatar metacurb commented on June 26, 2024

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

from train-departure-display.

CalamityJames avatar CalamityJames commented on June 26, 2024

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

from train-departure-display.

CalamityJames avatar CalamityJames commented on June 26, 2024

@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!

from train-departure-display.

chrisys avatar chrisys commented on June 26, 2024

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.

from train-departure-display.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.