From 181c68e97df01b3d77846ea75d72c1c6a26f9dff Mon Sep 17 00:00:00 2001 From: Vlad Zolotarov Date: Wed, 26 Apr 2017 14:54:34 -0400 Subject: [PATCH] token_metadata::get_host_id(ep): add a missing 'throw' Caught by PVS-Studio static analyzer: The object was created but it is not being used. The 'throw' keyword could be missing: throw runtime_error(FOO); Reported-by: Phillip Khandeliants Signed-off-by: Vlad Zolotarov --- locator/token_metadata.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locator/token_metadata.cc b/locator/token_metadata.cc index 8db3129083..184cc164f4 100644 --- a/locator/token_metadata.cc +++ b/locator/token_metadata.cc @@ -206,7 +206,7 @@ void token_metadata::update_host_id(const UUID& host_id, inet_address endpoint) utils::UUID token_metadata::get_host_id(inet_address endpoint) { if (!_endpoint_to_host_id_map.count(endpoint)) { - std::runtime_error(sprint("host_id for endpoint %s is not found", endpoint)); + throw std::runtime_error(sprint("host_id for endpoint %s is not found", endpoint)); } return _endpoint_to_host_id_map.at(endpoint); }