mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 00:16:27 +00:00
Additional data exception logging
This commit is contained in:
parent
16af1b48bc
commit
a3f14fca1c
@ -138,15 +138,19 @@ 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);
|
||||||
|
string currentHandlerName = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var handler in subscription.MessageHandlers)
|
foreach (var handler in subscription.MessageHandlers)
|
||||||
|
{
|
||||||
|
currentHandlerName = handler.Key;
|
||||||
if (handler.Value(subscription, JToken.Parse(data)))
|
if (handler.Value(subscription, JToken.Parse(data)))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
log.Write(LogVerbosity.Error, $"Exception during message processing: " + ex.ToString());
|
log.Write(LogVerbosity.Error, $"Exception during message processing\r\nProcessor: {currentHandlerName}\r\nException: {ex}\r\nData: {data}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user