mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-07 16:06:15 +00:00
Added catching of exception in message handler
This commit is contained in:
parent
1b6e1f99f8
commit
16af1b48bc
@ -138,9 +138,16 @@ namespace CryptoExchange.Net
|
||||
protected virtual void ProcessMessage(SocketSubscription subscription, string data)
|
||||
{
|
||||
log.Write(LogVerbosity.Debug, $"Socket {subscription.Socket.Id} received data: " + data);
|
||||
foreach (var handler in subscription.MessageHandlers)
|
||||
if (handler.Value(subscription, JToken.Parse(data)))
|
||||
return;
|
||||
try
|
||||
{
|
||||
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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user