Fix missing capitalization of error codes
This commit is contained in:
@@ -36,12 +36,12 @@ Status TablePlugin::HandleRequest(const api::TableParameters ¶ms, util::json
|
||||
|
||||
if (!CheckAllCoordinates(params.coordinates))
|
||||
{
|
||||
return Error("invalid-options", "Coordinates are invalid", result);
|
||||
return Error("InvalidOptions", "Coordinates are invalid", result);
|
||||
}
|
||||
|
||||
if (params.bearings.size() > 0 && params.coordinates.size() != params.bearings.size())
|
||||
{
|
||||
return Error("invalid-options", "Number of bearings does not match number of coordinates",
|
||||
return Error("InvalidOptions", "Number of bearings does not match number of coordinates",
|
||||
result);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ Status TablePlugin::HandleRequest(const api::TableParameters ¶ms, util::json
|
||||
static_cast<std::size_t>(max_locations_distance_table * max_locations_distance_table)))
|
||||
{
|
||||
return Error(
|
||||
"invalid-options",
|
||||
"InvalidOptions",
|
||||
"Number of entries " +
|
||||
std::to_string(params.sources.size() * params.destinations.size()) +
|
||||
" is higher than current maximum (" +
|
||||
@@ -63,7 +63,7 @@ Status TablePlugin::HandleRequest(const api::TableParameters ¶ms, util::json
|
||||
|
||||
if (result_table.empty())
|
||||
{
|
||||
return Error("no-table", "No table found", result);
|
||||
return Error("NoTable", "No table found", result);
|
||||
}
|
||||
|
||||
api::TableAPI table_api{facade, params};
|
||||
|
||||
@@ -173,7 +173,7 @@ Status TripPlugin::HandleRequest(const api::TripParameters ¶meters,
|
||||
auto phantom_node_pairs = GetPhantomNodes(parameters);
|
||||
if (phantom_node_pairs.size() != parameters.coordinates.size())
|
||||
{
|
||||
return Error("no-segment",
|
||||
return Error("NoSegment",
|
||||
std::string("Could not find a matching segment for coordinate ") +
|
||||
std::to_string(phantom_node_pairs.size()),
|
||||
json_result);
|
||||
|
||||
@@ -34,7 +34,7 @@ Status ViaRoutePlugin::HandleRequest(const api::RouteParameters &route_parameter
|
||||
if (max_locations_viaroute > 0 &&
|
||||
(static_cast<int>(route_parameters.coordinates.size()) > max_locations_viaroute))
|
||||
{
|
||||
return Error("too-big",
|
||||
return Error("TooBig",
|
||||
"Number of entries " + std::to_string(route_parameters.coordinates.size()) +
|
||||
" is higher than current maximum (" +
|
||||
std::to_string(max_locations_viaroute) + ")",
|
||||
@@ -43,13 +43,13 @@ Status ViaRoutePlugin::HandleRequest(const api::RouteParameters &route_parameter
|
||||
|
||||
if (!CheckAllCoordinates(route_parameters.coordinates))
|
||||
{
|
||||
return Error("invalid-value", "Invalid coordinate value.", json_result);
|
||||
return Error("InvalidValue", "Invalid coordinate value.", json_result);
|
||||
}
|
||||
|
||||
auto phantom_node_pairs = GetPhantomNodes(route_parameters);
|
||||
if (phantom_node_pairs.size() != route_parameters.coordinates.size())
|
||||
{
|
||||
return Error("no-segment",
|
||||
return Error("NoSegment",
|
||||
std::string("Could not find a matching segment for coordinate ") +
|
||||
std::to_string(phantom_node_pairs.size()),
|
||||
json_result);
|
||||
@@ -100,11 +100,11 @@ Status ViaRoutePlugin::HandleRequest(const api::RouteParameters &route_parameter
|
||||
|
||||
if (not_in_same_component)
|
||||
{
|
||||
return Error("no-route", "Impossible route between points", json_result);
|
||||
return Error("NoRoute", "Impossible route between points", json_result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Error("no-route", "No route found between points", json_result);
|
||||
return Error("NoRoute", "No route found between points", json_result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user