From de1f1b8ab34ba87f070ade31a8e35245abd6709a Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Fri, 18 Mar 2016 14:03:55 +0100 Subject: [PATCH] Makes Nearest plugin adhere to v5 spec for precondition violations, fixes #2108 --- src/engine/plugins/nearest.cpp | 2 +- unit_tests/library/nearest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/plugins/nearest.cpp b/src/engine/plugins/nearest.cpp index ffd2c6594..96b63e3eb 100644 --- a/src/engine/plugins/nearest.cpp +++ b/src/engine/plugins/nearest.cpp @@ -28,7 +28,7 @@ Status NearestPlugin::HandleRequest(const api::NearestParameters ¶ms, 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); diff --git a/unit_tests/library/nearest.cpp b/unit_tests/library/nearest.cpp index b1155dc16..5e70ae26b 100644 --- a/unit_tests/library/nearest.cpp +++ b/unit_tests/library/nearest.cpp @@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates) BOOST_REQUIRE(rc == Status::Error); const auto code = result.values.at("code").get().value; - BOOST_CHECK_EQUAL(code, "TooBig"); + BOOST_CHECK_EQUAL(code, "InvalidOptions"); } BOOST_AUTO_TEST_SUITE_END()