mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-22 22:02:59 +00:00
Added catching of exception in message handler
This commit is contained in:
@@ -138,9 +138,16 @@ namespace CryptoExchange.Net
|
|||||||
protected virtual void ProcessMessage(SocketSubscription subscription, string data)
|
protected virtual void ProcessMessage(SocketSubscription subscription, string data)
|
||||||
{
|
{
|
||||||
log.Write(LogVerbosity.Debug, $"Socket {subscription.Socket.Id} received data: " + data);
|
log.Write(LogVerbosity.Debug, $"Socket {subscription.Socket.Id} received data: " + data);
|
||||||
foreach (var handler in subscription.MessageHandlers)
|
try
|
||||||
if (handler.Value(subscription, JToken.Parse(data)))
|
{
|
||||||
return;
|
foreach (var handler in subscription.MessageHandlers)
|
||||||
|
if (handler.Value(subscription, JToken.Parse(data)))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
log.Write(LogVerbosity.Error, $"Exception during message processing: " + ex.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user