mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-07 16:06:15 +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)
|
||||
{
|
||||
log.Write(LogVerbosity.Debug, $"Socket {subscription.Socket.Id} received data: " + data);
|
||||
string currentHandlerName = null;
|
||||
try
|
||||
{
|
||||
foreach (var handler in subscription.MessageHandlers)
|
||||
{
|
||||
currentHandlerName = handler.Key;
|
||||
if (handler.Value(subscription, JToken.Parse(data)))
|
||||
return;
|
||||
}
|
||||
}
|
||||
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