Makes Nearest plugin adhere to v5 spec for precondition violations, fixes #2108

This commit is contained in:
Daniel J. Hofmann 2016-03-18 14:03:55 +01:00 committed by Patrick Niklaus
parent 210da11fbb
commit 9ec46222e3
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ Status NearestPlugin::HandleRequest(const api::NearestParameters &params,
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);

View File

@ -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()