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

Handle collection not found response in update_collection #450

Merged
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
5 changes: 4 additions & 1 deletion core/operations/management/collection_update.cxx
Expand Up @@ -58,7 +58,10 @@ collection_update_request::make_response(error_context::http&& ctx, const encode
} break;
case 404: {
std::regex scope_not_found("Scope with name .+ is not found");
if (std::regex_search(encoded.body.data(), scope_not_found)) {
std::regex collection_not_found("Collection with name .+ is not found");
if (std::regex_search(encoded.body.data(), collection_not_found)) {
response.ctx.ec = errc::common::collection_not_found;
} else if (std::regex_search(encoded.body.data(), scope_not_found)) {
response.ctx.ec = errc::common::scope_not_found;
} else {
response.ctx.ec = errc::common::bucket_not_found;
Expand Down