From dd180dc56a6d521f1757700d6fa34cbb06ccd2d3 Mon Sep 17 00:00:00 2001 From: badaix Date: Thu, 9 Dec 2021 18:08:38 +0100 Subject: [PATCH] Catch exception during pulse connect --- client/player/pulse_player.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/player/pulse_player.cpp b/client/player/pulse_player.cpp index 8f687b40..ad05a921 100644 --- a/client/player/pulse_player.cpp +++ b/client/player/pulse_player.cpp @@ -189,10 +189,20 @@ void PulsePlayer::worker() LOG(DEBUG, LOG_TAG) << "Waiting for a chunk to become available before reconnecting\n"; } - if (active_) + while (active_) { LOG(INFO, LOG_TAG) << "Chunk available, reconnecting to pulse\n"; - this->connect(); + try + { + connect(); + break; + } + catch (const std::exception& e) + { + LOG(ERROR, LOG_TAG) << "Exception while connecting to pulse: " << e.what() << endl; + disconnect(); + chronos::sleep(100); + } } } }