1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-22 20:51:19 +01:00

Fix: log deserialization errors

This commit is contained in:
Alexander Pankratov 2023-07-10 00:51:34 +02:00
parent 7d4cc59221
commit dec5bff3c9

View File

@ -198,7 +198,13 @@ final class ReadLoop extends Loop
} }
$this->logger->logger('Received payload from DC '.$this->datacenter, Logger::ULTRA_VERBOSE); $this->logger->logger('Received payload from DC '.$this->datacenter, Logger::ULTRA_VERBOSE);
try {
$deserialized = $this->API->getTL()->deserialize($message_data, ['type' => '', 'connection' => $this->connection]); $deserialized = $this->API->getTL()->deserialize($message_data, ['type' => '', 'connection' => $this->connection]);
} catch (\Throwable $e) {
Logger::log('Error during deserializing message (base64): ' . base64_encode($message_data), Logger::ERROR);
throw $e;
}
$sideEffects = $this->API->getTL()->getSideEffects(); $sideEffects = $this->API->getTL()->getSideEffects();
$message = new MTProtoIncomingMessage($deserialized, $message_id); $message = new MTProtoIncomingMessage($deserialized, $message_id);
$message->setSideEffects($sideEffects); $message->setSideEffects($sideEffects);