docs(readme): fix Error Handling import to use Brevo namespace - #98
Merged
Conversation
UnauthorizedError and TooManyRequestsError (and the other per-status error subclasses) are exported under the Brevo namespace (namespaceExport: Brevo), not as top-level named exports. The documented example imported them directly, which fails to compile. Fixes #93 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What
The README's Error Handling example imports
UnauthorizedErrorandTooManyRequestsErroras bare top-level names:That doesn't compile — TS2305, no exported member.
Why
generators.ymlsetsnamespaceExport: Brevofor the TypeScript SDK, sosrc/index.tsre-exports the whole API surface (including these per-status error subclasses) under aBrevonamespace:Only
BrevoError/BrevoTimeoutError(andBrevoClient) are genuinely top-level. The other typed subclasses (UnauthorizedError,TooManyRequestsError,BadRequestError, etc.) are only reachable asBrevo.UnauthorizedError, etc.Fix
Updates the example and the "Error Types" list to use the
Brevo.*qualified names, matching how the SDK is actually generated. Same fix applied to the corresponding page on the public docs site (developers.brevo.com).Fixes #93
🤖 Generated with Claude Code