Skip to content

Commit

Permalink
CXXCBC-421: Return feature_not_available when query preserve expiry i…
Browse files Browse the repository at this point in the history
…s not supported
  • Loading branch information
DemetrisChr committed Jan 26, 2024
1 parent 8696c0b commit 95c034c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/operations/document_query.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,12 @@ query_request::make_response(error_context::query&& ctx, const encoded_response_
response.ctx.first_error_message = response.meta.errors->front().message;
switch (response.ctx.first_error_code) {
case 1065: /* IKey: "service.io.request.unrecognized_parameter" */
response.ctx.ec = errc::common::invalid_argument;
if ((response.ctx.first_error_message.find("Unrecognized parameter in request") != std::string::npos) &&
(response.ctx.first_error_message.find("preserve_expiry") != std::string::npos)) {
response.ctx.ec = errc::common::feature_not_available;
} else {
response.ctx.ec = errc::common::invalid_argument;
}
break;
case 1080: /* IKey: "timeout" */
response.ctx.ec = errc::common::unambiguous_timeout;
Expand Down

0 comments on commit 95c034c

Please sign in to comment.