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

CXXCBC-421: Return feature_not_available when query preserve expiry is not supported #510

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion core/operations/document_query.cxx
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