Skip to content

Commit

Permalink
Always attempt to extract common query code if error has not been set (
Browse files Browse the repository at this point in the history
  • Loading branch information
DemetrisChr committed Apr 16, 2024
1 parent b85bfeb commit 1b506b0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/operations/document_query.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,16 @@ query_request::make_response(error_context::query&& ctx, const encoded_response_
response.ctx.ec = errc::query::index_failure;
} else if (response.ctx.first_error_code >= 4000 && response.ctx.first_error_code < 5000) {
response.ctx.ec = errc::query::planning_failure;
} else {
auto common_ec =
management::extract_common_query_error_code(response.ctx.first_error_code, response.ctx.first_error_message);
if (common_ec) {
response.ctx.ec = common_ec.value();
}
}
break;
}
if (!response.ctx.ec) {
auto common_ec =
management::extract_common_query_error_code(response.ctx.first_error_code, response.ctx.first_error_message);
if (common_ec) {
response.ctx.ec = common_ec.value();
}
}
}
if (!response.ctx.ec) {
CB_LOG_TRACE("Unexpected error returned by query engine: client_context_id=\"{}\", body={}",
Expand Down

0 comments on commit 1b506b0

Please sign in to comment.