Skip to content

fix(client): error handling, tz-aware dates, date validation (0.1.1) - #9

Merged
Autumn-Atlas merged 1 commit into
masterfrom
agent/0.1.1-error-handling
Sep 13, 2026
Merged

Autumn-Atlas merged 1 commit into
masterfrom
agent/0.1.1-error-handling

Conversation

@Autumn-Atlas

Copy link
Copy Markdown
Contributor

Live-API bug probing of the published 0.1.0 found three client bugs. All fixed with regression tests (44 pass).

Fixes

  1. CurrentsAPIError — 401 payloads carry msg, not message, so .message/.code were dead and str(e) was a raw dict repr. Now: message falls back to msg, str(e) is human-readable, .status coerces numeric strings to int (e.status == 401 works).
  2. TZ-aware datetimessearch(start_date=datetime(2026,9,1,tzinfo=+08:00)) was sent as ...T00:00:00Z (8h off, silent). Now converted to UTC first.
  3. Impossible datessearch(start_date="2026-13-45") leaked dateutil.parser.ParserError; now raises documented ValueError.

Validation

  • 44/44 tests pass (4 new regressions)
  • Artifacts built + twine check PASSED for 0.1.1

…ror on bad dates

- CurrentsAPIError: message falls back to API 'msg' key; str(e) returns the
  human-readable message; status coerces numeric strings to int
- search(): tz-aware datetimes converted to UTC before strftime
- _parse_date: unparsable date strings raise ValueError, not ParserError
- 4 new regression tests; version 0.1.1
@Autumn-Atlas
Autumn-Atlas merged commit aa8a7ae into master Sep 13, 2026
5 checks passed
@Autumn-Atlas
Autumn-Atlas deleted the agent/0.1.1-error-handling branch September 13, 2026 07:22
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.

1 participant