Skip to content

Commit

Permalink
update error message
Browse files Browse the repository at this point in the history
  • Loading branch information
krunal1313 committed Dec 20, 2024
1 parent 286f185 commit 6f111bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ Option<bool> field::json_field_to_field(bool enable_nested_fields, nlohmann::jso
} else {
for(const auto& item : field_json[fields::token_separators]) {
if(!item.is_string() || item.empty() || item.get<std::string>().size() != 1) {
return Option<bool>(400, "Invalid field token_separators val.");
return Option<bool>(400, "The `token_separators` must be an array of characters.");
}
}
}
Expand All @@ -440,7 +440,7 @@ Option<bool> field::json_field_to_field(bool enable_nested_fields, nlohmann::jso
} else {
for(const auto& item : field_json[fields::symbols_to_index]) {
if (!item.is_string() || item.empty() || item.get<std::string>().size() != 1) {
return Option<bool>(400, "Invalid field symbols_to_index val.");
return Option<bool>(400, "The `symbols_to_index` must be an array of characters.");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/collection_all_fields_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@ TEST_F(CollectionAllFieldsTest, FieldTokenSeparators) {

create_op = collectionManager.create_collection(invalid_schema);
ASSERT_FALSE(create_op.ok());
ASSERT_EQ("Invalid field token_separators val.", create_op.error());
ASSERT_EQ("The `token_separators` must be an array of characters.", create_op.error());

//non string vals not permitted
invalid_schema = R"({
Expand All @@ -1921,7 +1921,7 @@ TEST_F(CollectionAllFieldsTest, FieldTokenSeparators) {

create_op = collectionManager.create_collection(invalid_schema);
ASSERT_FALSE(create_op.ok());
ASSERT_EQ("Invalid field symbols_to_index val.", create_op.error());
ASSERT_EQ("The `symbols_to_index` must be an array of characters.", create_op.error());
}

TEST_F(CollectionAllFieldsTest, FieldTokenSeparatorsOnRestart) {
Expand Down

0 comments on commit 6f111bc

Please sign in to comment.