Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(documents): throw on empty lists of documents #262

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

tharropoulos
Copy link
Collaborator

TDLR

Addresses #188

Change Summary

This pull request introduces a new error handling mechanism in the Documents class within the src/Typesense/Documents.ts file. The main changes include the addition of a new error type and checks to ensure that provided documents are not empty.

Error handling improvements:

Utility function addition:

PR Checklist

Copy link
Member

@jasonbosco jasonbosco left a comment

Choose a reason for hiding this comment

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

Could you add a unit test for this?

- add test for empty array input
- add test for empty string input
- add test for null input
- add test for undefined input
@tharropoulos
Copy link
Collaborator Author

Could you add a unit test for this?

Added tests in 3a55318

@jasonbosco jasonbosco merged commit 066349d into typesense:master Feb 6, 2025
1 check 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.

2 participants