Catch exception during pulse connect

This commit is contained in:
badaix 2021-12-09 18:08:38 +01:00
parent e7f1519ab2
commit dd180dc56a

View file

@ -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);
}
}
}
}