Skip to content

Add TeamAPI and improve error handling for v0.2.0#12

Merged
delano merged 4 commits intomainfrom
delano/next
Apr 2, 2026
Merged

Add TeamAPI and improve error handling for v0.2.0#12
delano merged 4 commits intomainfrom
delano/next

Conversation

@delano
Copy link
Copy Markdown
Member

@delano delano commented Apr 2, 2026

Summary

This release expands the SDK from a single-purpose email sender to a comprehensive Lettermint client with two distinct API surfaces:

  • SendingAPI — Project-level email sending with fluent builder (existing functionality, Client alias preserved for backward compatibility)
  • TeamAPI — Team-level management for domains, projects, routes, webhooks, messages, suppressions, and stats

Also improves error handling by introducing ResponseParsingError with original exception preservation, following the pattern established by ConnectionError and WebhookJsonDecodeError. This addresses review feedback about preserving debugging context when API responses fail to parse.

What's New

  • Lettermint::TeamAPI client with resource accessors for all team management endpoints
  • Lettermint::ResponseParsingError wraps Faraday::ParsingError with original_exception attribute
  • Comprehensive documentation: docs/api.md (HTTP reference) and docs/sdk.md (Ruby SDK reference)
  • Updated error hierarchy in CLAUDE.md reflecting all current exception types

Backward Compatibility

  • Lettermint::Client remains as alias to SendingAPI
  • Existing code catching Lettermint::Error will still catch the new ResponseParsingError
  • No breaking changes to the email sending interface

Test Plan

  • Run bundle exec rspec — all 447 specs pass
  • Verify ResponseParsingError preserves original exception
  • Confirm Client alias works for existing integrations

delano added 3 commits April 1, 2026 22:36
- Bump version to 0.2.0
- Add changelog entry for TeamAPI, SendingAPI, raw HTTP methods, ConnectionError
- Update README with TeamAPI documentation and examples
- Replace Lettermint::Client references with SendingAPI
- docs/api.md: Raw HTTP API reference with endpoints, enums, and data types
- docs/sdk.md: Ruby SDK usage guide with code examples for all resources
Addresses review feedback: preserve original Faraday::ParsingError for
debugging when API returns unexpected content. Follows pattern established
by ConnectionError and WebhookJsonDecodeError.

Also merges upstream SSL error handling and non-JSON response tests.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Lettermint Ruby SDK to version 0.2.0, introducing a significant architectural change by splitting the client into SendingAPI and TeamAPI. It adds new resource infrastructure, raw HTTP methods for direct API access, and a specific ResponseParsingError for improved error handling. Additionally, extensive documentation for both the Team API and the SDK has been added. A review comment suggests simplifying the error message for the new ResponseParsingError to avoid redundancy with the class name.

Address PR review feedback: rephrase message to reduce redundancy
with the class name ResponseParsingError.
@delano delano merged commit 06863d5 into main Apr 2, 2026
6 checks passed
@delano delano deleted the delano/next branch April 2, 2026 20:36
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