Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 1fa9091

Browse files
committed
Remove unhelpful catch blocks
1 parent 502e74d commit 1fa9091

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

src/ServiceLayer.Mesh/Messaging/QueueClientBase.cs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,13 @@ private QueueClient CreatePoisonClient()
3737

3838
protected async Task SendJsonMessageAsync<T>(T message)
3939
{
40-
try
41-
{
42-
var json = JsonSerializer.Serialize(message, QueueJsonOptions);
43-
await Client.SendMessageAsync(json);
44-
}
45-
catch (Exception e)
46-
{
47-
// TODO - consider including file ID or correlation ID in error logs
48-
logger.LogError(e, "Error sending message to queue {QueueName}", QueueName);
49-
throw;
50-
}
40+
var json = JsonSerializer.Serialize(message, QueueJsonOptions);
41+
await Client.SendMessageAsync(json);
5142
}
5243

5344
protected async Task SendToPoisonQueueAsync<T>(T message)
5445
{
55-
try
56-
{
57-
var json = JsonSerializer.Serialize(message, QueueJsonOptions);
58-
await PoisonClient.SendMessageAsync(json);
59-
}
60-
catch (Exception e)
61-
{
62-
logger.LogError(e, "Error sending message to poison queue {PoisonQueueName}", $"{QueueName}-poison");
63-
throw;
64-
}
46+
var json = JsonSerializer.Serialize(message, QueueJsonOptions);
47+
await PoisonClient.SendMessageAsync(json);
6548
}
6649
}

0 commit comments

Comments
 (0)