Replace some throws with force_stop

This commit is contained in:
Vitaliy Filippov
2022-02-20 00:21:19 +03:00
parent 951272f27f
commit 7cbfdff41a
2 changed files with 7 additions and 3 deletions
+4 -2
View File
@@ -457,7 +457,8 @@ void osd_t::renew_lease()
if (err == "" && data["result"]["TTL"].string_value() == "")
{
// Die
throw std::runtime_error("etcd lease has expired");
fprintf(stderr, "Error refreshing etcd lease\n");
force_stop(1);
}
if (err != "")
{
@@ -466,7 +467,8 @@ void osd_t::renew_lease()
if (etcd_failed_attempts > st_cli.max_etcd_attempts)
{
// Die
throw std::runtime_error("Cluster connection failed");
fprintf(stderr, "Cluster connection failed\n");
force_stop(1);
}
// Retry
tfd->set_timer(st_cli.etcd_quick_timeout, false, [this](int timer_id)