Skip to content

fix(errors): export error helpers and types from package entry point - #1864

Open
Tyagiquamar wants to merge 2 commits into
GetStream:masterfrom
Tyagiquamar:fix-export-error-helpers-1848
Open

Tyagiquamar wants to merge 2 commits into
GetStream:masterfrom
Tyagiquamar:fix-export-error-helpers-1848

Conversation

@Tyagiquamar

@Tyagiquamar Tyagiquamar commented Sep 13, 2026

Copy link
Copy Markdown

Fixes #1848

Summary

\�rrors.ts\ defines key error helpers, types, and error code mappings (\isAPIError, \isErrorRetryable, \APIErrorCodes, \isConnectionIDError, \isWSFailure, \isErrorResponse, \APIError), but they were not exported from the package entry point (\src/index.ts).

Changes

  • Added \�xport * from './errors';\ to \src/index.ts\ so SDK consumers can import error classification utilities directly from \stream-chat.

@szuperaz szuperaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR, exporting error helpers makes sense. However adding tests that assert something is exported from the client is not something we do, can you please revert the new test?

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
@Tyagiquamar

Copy link
Copy Markdown
Author

Reverted the export assertions test as requested. The PR now only includes the error helper/type exports in src/index.ts.

@MartinCupela

Copy link
Copy Markdown
Contributor

@Tyagiquamar what is that you are missing from the errors.ts file? I believe the contents were not exported on purpose.

@Tyagiquamar

Copy link
Copy Markdown
Author

The main missing pieces are isAPIError, isErrorRetryable, and APIErrorCodes, as described in #1848.

The use case is an app-level retry policy: consumers can fail fast on non-retryable API errors and retry things like rate limits/timeouts using the retryability information the SDK already maintains.

Currently these helpers exist in errors.ts, but they aren't importable from the stream-chat package entry point. If exporting the whole module isn't intended, I'm happy to narrow this to only the helpers/types you consider part of the public API.

@szuperaz szuperaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me now, lets also wait for @MartinCupela's review

@MartinCupela

Copy link
Copy Markdown
Contributor

It looks like the list of APIErrorCodes is incomplete. I will create a new PR that fixes it.

@Tyagiquamar

Copy link
Copy Markdown
Author

It looks like the list of APIErrorCodes is incomplete. I will create a new PR that fixes it.

Thanks, that makes sense. I'll leave this open for now so we can revisit the public exports once your APIErrorCodes update lands. If you'd prefer this PR to be closed in favor of your change, I'm happy to do that.

@MartinCupela

Copy link
Copy Markdown
Contributor

I have asked for a review by the BE team. The issue is that such a list can get our of sync pretty fast, so there is discussion, whether we could do better. If not, I will provide reviewed updated list and export it.

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.

Error helpers in errors.ts (isAPIError, isErrorRetryable, APIErrorCodes) are not exported from the package entry point

3 participants