Skip to content

docs(readme): fix Error Handling import to use Brevo namespace - #98

Merged
mourraille merged 1 commit into
mainfrom
fix/readme-error-namespace-93
Sep 3, 2026
Merged

docs(readme): fix Error Handling import to use Brevo namespace#98
mourraille merged 1 commit into
mainfrom
fix/readme-error-namespace-93

Conversation

@mourraille

@mourraille mourraille commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

What

The README's Error Handling example imports UnauthorizedError and TooManyRequestsError as bare top-level names:

import { BrevoError, UnauthorizedError, TooManyRequestsError } from '@getbrevo/brevo';

That doesn't compile — TS2305, no exported member.

Why

generators.yml sets namespaceExport: Brevo for the TypeScript SDK, so src/index.ts re-exports the whole API surface (including these per-status error subclasses) under a Brevo namespace:

export * as Brevo from "./api/index.js";
export { BrevoError, BrevoTimeoutError } from "./errors/index.js";

Only BrevoError / BrevoTimeoutError (and BrevoClient) are genuinely top-level. The other typed subclasses (UnauthorizedError, TooManyRequestsError, BadRequestError, etc.) are only reachable as Brevo.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

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>
@mourraille
mourraille merged commit a6fea00 into main Sep 3, 2026
3 checks passed
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.

v6.0.2: UnauthorizedError and TooManyRequestsError are documented but can't be imported from @getbrevo/brevo

1 participant