Skip to content

Improve .unique() error message: print document _ids #59

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
improve unique() error message
  • Loading branch information
djbalin committed Mar 12, 2025
commit cac09c1f099f57996a4960f536913b8d7234b342
2 changes: 1 addition & 1 deletion npm-packages/convex/src/server/impl/query_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export class QueryImpl implements Query<GenericTableInfo> {
return null;
}
if (first_two_array.length === 2) {
throw new Error("unique() query returned more than one result");
throw new Error(`unique() query returned more than one result. First pair of results: ${first_two_array[0]._id} and ${first_two_array[1]._id}`);
}
return first_two_array[0];
}
Expand Down