Add error message

This commit is contained in:
badaix 2025-02-07 14:09:53 +01:00 committed by Johannes Pohl
parent 121a0beca7
commit 30ab9773cb
5 changed files with 92 additions and 1 deletions

View file

@ -59,6 +59,7 @@
#include "browseZeroConf/browse_mdns.hpp"
#include "common/aixlog.hpp"
#include "common/message/client_info.hpp"
#include "common/message/error.hpp"
#include "common/message/hello.hpp"
#include "common/message/time.hpp"
#include "common/snap_exception.hpp"
@ -299,6 +300,11 @@ void Controller::getNextMessage()
player_->setVolume({serverSettings_->getVolume() / 100., serverSettings_->isMuted()});
// }
}
else if (response->type == message_type::kError)
{
auto error = msg::message_cast<msg::Error>(std::move(response));
LOG(ERROR, LOG_TAG) << "Received error: " << error->message << ", code: " << error->code << "\n";
}
else
{
LOG(WARNING, LOG_TAG) << "Unexpected message received, type: " << response->type << "\n";