mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Add error system
This commit is contained in:
@@ -127,8 +127,10 @@ void Communication::readTask() {
|
||||
if(packetizer->input(readBytes)) {
|
||||
for(auto& packet : packetizer->output()) {
|
||||
std::shared_ptr<Message> msg;
|
||||
if(!decoder->decode(msg, packet))
|
||||
continue; // TODO Report an error to the user, we failed to decode this packet
|
||||
if(!decoder->decode(msg, packet)) {
|
||||
err(APIError::Unknown); // TODO Use specific error
|
||||
continue;
|
||||
}
|
||||
|
||||
for(auto& cb : messageCallbacks) {
|
||||
if(!closing) { // We might have closed while reading or processing
|
||||
|
||||
Reference in New Issue
Block a user