Change error code

This commit is contained in:
ManyTheFish 2024-12-05 14:48:29 +01:00
parent fc1df5793c
commit a0a3b55700
3 changed files with 6 additions and 6 deletions

View File

@ -279,7 +279,7 @@ InvalidSearchPage , InvalidRequest , BAD_REQUEST ;
InvalidSearchQ , InvalidRequest , BAD_REQUEST ; InvalidSearchQ , InvalidRequest , BAD_REQUEST ;
InvalidFacetSearchQuery , InvalidRequest , BAD_REQUEST ; InvalidFacetSearchQuery , InvalidRequest , BAD_REQUEST ;
InvalidFacetSearchName , InvalidRequest , BAD_REQUEST ; InvalidFacetSearchName , InvalidRequest , BAD_REQUEST ;
InvalidFacetSearchDisabled , InvalidRequest , BAD_REQUEST ; FacetSearchDisabled , InvalidRequest , BAD_REQUEST ;
InvalidSearchVector , InvalidRequest , BAD_REQUEST ; InvalidSearchVector , InvalidRequest , BAD_REQUEST ;
InvalidSearchShowMatchesPosition , InvalidRequest , BAD_REQUEST ; InvalidSearchShowMatchesPosition , InvalidRequest , BAD_REQUEST ;
InvalidSearchShowRankingScore , InvalidRequest , BAD_REQUEST ; InvalidSearchShowRankingScore , InvalidRequest , BAD_REQUEST ;

View File

@ -1410,7 +1410,7 @@ pub fn perform_facet_search(
if !index.facet_search(&rtxn)? { if !index.facet_search(&rtxn)? {
return Err(ResponseError::from_msg( return Err(ResponseError::from_msg(
"The facet search is disabled for this index".to_string(), "The facet search is disabled for this index".to_string(),
Code::InvalidFacetSearchDisabled, Code::FacetSearchDisabled,
)); ));
} }

View File

@ -225,9 +225,9 @@ async fn add_documents_and_deactivate_facet_search() {
snapshot!(response, @r###" snapshot!(response, @r###"
{ {
"message": "The facet search is disabled for this index", "message": "The facet search is disabled for this index",
"code": "invalid_facet_search_disabled", "code": "facet_search_disabled",
"type": "invalid_request", "type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_facet_search_disabled" "link": "https://docs.meilisearch.com/errors#facet_search_disabled"
} }
"###); "###);
} }
@ -256,9 +256,9 @@ async fn deactivate_facet_search_and_add_documents() {
snapshot!(response, @r###" snapshot!(response, @r###"
{ {
"message": "The facet search is disabled for this index", "message": "The facet search is disabled for this index",
"code": "invalid_facet_search_disabled", "code": "facet_search_disabled",
"type": "invalid_request", "type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_facet_search_disabled" "link": "https://docs.meilisearch.com/errors#facet_search_disabled"
} }
"###); "###);
} }