Add TeamAPI and improve error handling for v0.2.0#12
Merged
Conversation
- 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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This release expands the SDK from a single-purpose email sender to a comprehensive Lettermint client with two distinct API surfaces:
Clientalias preserved for backward compatibility)Also improves error handling by introducing
ResponseParsingErrorwith original exception preservation, following the pattern established byConnectionErrorandWebhookJsonDecodeError. This addresses review feedback about preserving debugging context when API responses fail to parse.What's New
Lettermint::TeamAPIclient with resource accessors for all team management endpointsLettermint::ResponseParsingErrorwrapsFaraday::ParsingErrorwithoriginal_exceptionattributedocs/api.md(HTTP reference) anddocs/sdk.md(Ruby SDK reference)Backward Compatibility
Lettermint::Clientremains as alias toSendingAPILettermint::Errorwill still catch the newResponseParsingErrorTest Plan
bundle exec rspec— all 447 specs passResponseParsingErrorpreserves original exceptionClientalias works for existing integrations