mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 15:46:42 +02:00
handle async exception properly
This commit is contained in:
parent
841c105704
commit
b58ecfdcf1
2 changed files with 5 additions and 4 deletions
|
@ -84,6 +84,7 @@ void ClientConnection::start()
|
||||||
connected_ = true;
|
connected_ = true;
|
||||||
SLOG(NOTICE) << "Connected to " << socket_->remote_endpoint().address().to_string() << endl;
|
SLOG(NOTICE) << "Connected to " << socket_->remote_endpoint().address().to_string() << endl;
|
||||||
active_ = true;
|
active_ = true;
|
||||||
|
sumTimeout_ = chronos::msec(0);
|
||||||
readerThread_ = new thread(&ClientConnection::reader, this);
|
readerThread_ = new thread(&ClientConnection::reader, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,8 +197,8 @@ void Controller::worker()
|
||||||
{
|
{
|
||||||
if (async_exception_)
|
if (async_exception_)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "Async exception: " << async_exception_->what() << "\n";
|
LOG(DEBUG) << "Async exception: " << async_exception_->what() << "\n";
|
||||||
throw *async_exception_;
|
throw SnapException(async_exception_->what());
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<msg::Time> reply = clientConnection_->sendReq<msg::Time>(&timeReq, chronos::msec(2000));
|
shared_ptr<msg::Time> reply = clientConnection_->sendReq<msg::Time>(&timeReq, chronos::msec(2000));
|
||||||
|
@ -219,8 +219,8 @@ void Controller::worker()
|
||||||
chronos::sleep(100);
|
chronos::sleep(100);
|
||||||
if (async_exception_)
|
if (async_exception_)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "Async exception: " << async_exception_->what() << "\n";
|
LOG(DEBUG) << "Async exception: " << async_exception_->what() << "\n";
|
||||||
throw *async_exception_;
|
throw SnapException(async_exception_->what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue