mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-08 20:27:38 +02:00
Catch exception during pulse connect
This commit is contained in:
parent
e7f1519ab2
commit
dd180dc56a
1 changed files with 12 additions and 2 deletions
|
@ -189,10 +189,20 @@ void PulsePlayer::worker()
|
||||||
LOG(DEBUG, LOG_TAG) << "Waiting for a chunk to become available before reconnecting\n";
|
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";
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue