mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
add error catch to serialize
This commit is contained in:
parent
d75136bbc3
commit
c17ea7607f
@ -1257,7 +1257,16 @@ namespace QuantumUNET
|
|||||||
if (handlers.ContainsKey(msgType) && m_LocalConnection != null)
|
if (handlers.ContainsKey(msgType) && m_LocalConnection != null)
|
||||||
{
|
{
|
||||||
var writer = new QNetworkWriter();
|
var writer = new QNetworkWriter();
|
||||||
msg.Serialize(writer);
|
try
|
||||||
|
{
|
||||||
|
msg.Serialize(writer);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
QLog.Error($"Error serializing msgId:{msgType} - {ex}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var reader = new QNetworkReader(writer);
|
var reader = new QNetworkReader(writer);
|
||||||
m_LocalConnection.InvokeHandler(msgType, reader, channelId);
|
m_LocalConnection.InvokeHandler(msgType, reader, channelId);
|
||||||
result = true;
|
result = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user