1
0
mirror of synced 2024-11-05 02:59:16 +00:00

Slightly improved logging to fix #28

Logging the body is not worth it at the moment, as the original issue regarding corrupt body contents has been fixed already
This commit is contained in:
Mark van Renswoude 2021-07-18 13:52:49 +02:00
parent f4d008d6a9
commit e9a7e32bf5

View File

@ -44,9 +44,16 @@ namespace Tapeti.Connection
object message = null; object message = null;
try try
{ {
message = messageSerializer.Deserialize(body, properties); try
if (message == null) {
throw new ArgumentException("Message body could not be deserialized into a message object", nameof(body)); message = messageSerializer.Deserialize(body, properties);
if (message == null)
throw new ArgumentException($"Message body for routing key '{routingKey}' could not be deserialized into a message object", nameof(body));
}
catch (Exception e)
{
throw new ArgumentException($"Message body for routing key '{routingKey}' could not be deserialized into a message object: {e.Message}", nameof(body), e);
}
return await DispatchMessage(message, new MessageContextData return await DispatchMessage(message, new MessageContextData
{ {