Makes Nearest plugin adhere to v5 spec for precondition violations, fixes #2108
This commit is contained in:
parent
210da11fbb
commit
9ec46222e3
@ -28,7 +28,7 @@ Status NearestPlugin::HandleRequest(const api::NearestParameters ¶ms,
|
|||||||
|
|
||||||
if (params.coordinates.size() != 1)
|
if (params.coordinates.size() != 1)
|
||||||
{
|
{
|
||||||
return Error("TooBig", "Only one input coordinate is supported", json_result);
|
return Error("InvalidOptions", "Only one input coordinate is supported", json_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto phantom_nodes = GetPhantomNodes(params, params.number_of_results);
|
auto phantom_nodes = GetPhantomNodes(params, params.number_of_results);
|
||||||
|
@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
|
|||||||
BOOST_REQUIRE(rc == Status::Error);
|
BOOST_REQUIRE(rc == Status::Error);
|
||||||
|
|
||||||
const auto code = result.values.at("code").get<json::String>().value;
|
const auto code = result.values.at("code").get<json::String>().value;
|
||||||
BOOST_CHECK_EQUAL(code, "TooBig");
|
BOOST_CHECK_EQUAL(code, "InvalidOptions");
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
Loading…
Reference in New Issue
Block a user