server: fix typo
This commit is contained in:
@ -672,10 +672,14 @@ Server::Private::find_handler(const Parameters& params)
|
|||||||
const auto skip_dups{get_bool_or(params, ":skip-dups", false)};
|
const auto skip_dups{get_bool_or(params, ":skip-dups", false)};
|
||||||
const auto include_related{get_bool_or(params, ":include-related", false)};
|
const auto include_related{get_bool_or(params, ":include-related", false)};
|
||||||
|
|
||||||
|
auto sort_field = std::invoke([&]()->Option<Field>{
|
||||||
auto sort_field = field_from_name(sortfieldstr);
|
if (sortfieldstr.size() < 2)
|
||||||
if (!sort_field && sortfieldstr.empty())
|
return Nothing;
|
||||||
throw Error{Error::Code::InvalidArgument, "invalid sort field %s",
|
else
|
||||||
|
return field_from_name(sortfieldstr.substr(1));
|
||||||
|
});
|
||||||
|
if (!sort_field && !sortfieldstr.empty())
|
||||||
|
throw Error{Error::Code::InvalidArgument, "invalid sort field '%s'",
|
||||||
sortfieldstr.c_str()};
|
sortfieldstr.c_str()};
|
||||||
if (batch_size < 1)
|
if (batch_size < 1)
|
||||||
throw Error{Error::Code::InvalidArgument, "invalid batch-size %d", batch_size};
|
throw Error{Error::Code::InvalidArgument, "invalid batch-size %d", batch_size};
|
||||||
|
|||||||
Reference in New Issue
Block a user