From 24a713bb7aa22295b1518b779dfa5f16abf33f28 Mon Sep 17 00:00:00 2001 From: cappy-dev Date: Tue, 25 Aug 2026 05:02:57 +0000 Subject: [PATCH] docs: close client in README example --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9d4d741..0e5545b 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,12 @@ A typed Dart client for the [Statbotics](https://www.statbotics.io) API v3: EPA import 'package:statbotics_client/statbotics_client.dart'; final client = StatboticsClient(); -final events = await client.getEvents(2026); -final teams = await client.getEventTeams('2026txhou'); -client.close(); +try { + final events = await client.getEvents(2026); + final teams = await client.getEventTeams('2026txhou'); +} finally { + client.close(); +} ``` No API key needed. Transient server errors are retried with a pluggable `sleep` (inject a no-op in tests); non-transient failures throw `StatboticsApiException` with the status code.