Skip to content

tennisscores 0.02: readable error messages on the watch screen - #4320

Merged
thyttan merged 1 commit into
espruino:masterfrom
bensynapse:tennisscores-error-presentation
Aug 17, 2026
Merged

tennisscores 0.02: readable error messages on the watch screen#4320
thyttan merged 1 commit into
espruino:masterfrom
bensynapse:tennisscores-error-presentation

Conversation

@bensynapse

Copy link
Copy Markdown
Contributor

Follow-up to #4316, as promised. When merging, @thyttan asked:

Minor thing, the timeout error is a bit hard to read on the watch screen [...] if you fix the presentation of the errors please post another PR 👍

This fixes the presentation of every error state. Before, any failure dumped the raw rejection text ("Timeout", "Failed to connect to api.livetennisapi.com/0.0.0.0:443", ...) wrapped in the 6x8 font under a generic "Error" heading — unreadable at watch size, as in thyttan's screenshot. Now each failure is mapped to a short human message, centered and wrapped in the large (6x8 x2) font, with a small "tap to retry" hint at the bottom (tap was already the app's refresh gesture):

Failure Before After
Request timed out (Bangle.http "Timeout") Error + raw Timeout in tiny font Request timed out
Phone unreachable / no internet / DNS (Gadgetbridge err strings like "Failed to connect to ...", "Unable to resolve host ...") raw multi-line URL soup No connection
Not connected to Bluetooth raw Not connected to Bluetooth Not connected
No Bangle.http (no Gadgetbridge/android app) raw Gadgetbridge required Needs Gadgetbridge
Bad/expired API key (API returns {"error":"unauthorized"}) Bad response (misleading) Check API key
API rate limit hit Bad response Rate limited
Unparseable/empty body raw parse error Bad response
Anything unrecognised raw text Error + first 40 chars in small font below, so it stays debuggable

The API error body ({"error":"..."}) is now checked after JSON parse, which is what turns a 401 into "Check API key" instead of the old misleading "Bad response". The missing-key case (No API key / Set one in Settings) already had its own screen and is unchanged. No other behavior changes.

Housekeeping per convention: version bumped to 0.02 in metadata.json, ChangeLog line added.

Checks: bin/sanitycheck.js passes (0 errors, 0 warnings) and eslint apps/tennisscores --max-warnings 0 is clean.

🤖 Generated with Claude Code

Follow-up to espruino#4316: replace the raw error text (unreadable at watch
size) with short human messages -- No connection, Request timed out,
Check API key, Not connected, Needs Gadgetbridge, Rate limited, Bad
response -- centered and wrapped in the large font, with a small
'tap to retry' hint at the bottom. Unrecognised errors keep a short
one-line detail in the small font so they stay debuggable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@thyttan

thyttan commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@thyttan
thyttan merged commit b2e265f into espruino:master Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants