BenjaminEHowe / yamm-client

The backend for YAMM - a money manager tool.
https://yamm.io
GNU Affero General Public License v3.0
0 stars 0 forks source link

Handle NewDay Unavailability #11

Open BenjaminEHowe opened 6 years ago

BenjaminEHowe commented 6 years ago

NewDay's online portal seems to be somewhat unreliable. See the below stack trace for what happens when it goes "down":

io.yamm.backend.YAMMRuntimeException: System currently unavailable, please try again.
    at io.yamm.backend.providers.NewDay.authenticate(NewDay.java:172)
    at io.yamm.backend.providers.NewDay.callEndpoint(NewDay.java:232)
    at io.yamm.backend.providers.NewDay.callEndpoint(NewDay.java:182)
    at io.yamm.backend.providers.NewDay.callAccountSummaryEndpoint(NewDay.java:249)
    at io.yamm.backend.providers.NewDay.getAvailableToSpend(NewDay.java:415)
    at io.yamm.client.DataHandler.accountToJSON(DataHandler.java:146)
    at io.yamm.client.DataHandler.accountsToJSON(DataHandler.java:169)
    at io.yamm.client.Webserver.serve(Webserver.java:240)
    at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
    at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
    at java.lang.Thread.run(Thread.java:748)

It would be good to mitigate this somehow, but I'm not sure how! One option would be to just return cached data (and show an error to the user) but this would fail if the caches are empty. The YAMM web app probably needs a "data not available" state, or similar.

BenjaminEHowe commented 6 years ago

Examples of previous unavailability:

BenjaminEHowe commented 6 years ago

They had a second outage in April 2018.