jfcameron / jfc-wanikani_reviews_icon

linux system tray icon indicating # of reviews ready for Wanikani
MIT License
0 stars 0 forks source link

unhandled exception during wanikani service update #1

Open jfcameron opened 3 years ago

jfcameron commented 3 years ago

Description of problem

when the wanikani server software is being updated, the service's API continues to respond, but the response bodies are junk data. This program assumes response bodies always contain well formed JSON, so when a junk response is received, the resulting parse exception is not handled, resulting in the termination of the program.

the wanikani service is rarely in this state. Typically it is either reachable and returns well-formed JSON or it is completely unreachable.

Current program behaviour

The program prints to standard out: unhandled json parsing error, the unparsable string, then exits

Description of solution

If json parsing fails, go to an error state, set the tooltip to an error message, "could not understand respones from server" + any additional info. Maybe add a "?" icon and use that, to visibly distinguish between a network error and a parse failure.

jfcameron commented 3 years ago

occurs on 500 erors as well. again, this is an issue of not dealing with a json parse exception