rabbitmq / rabbitmq-dotnet-client

RabbitMQ .NET client for .NET Standard 2.0+ and .NET 4.6.2+
https://www.rabbitmq.com/dotnet.html
Other
2.07k stars 579 forks source link

Do not create exceptions just for logging #1440

Closed paulomorgado closed 4 months ago

paulomorgado commented 10 months ago

Describe the bug

Some exceptions are being created just for logging here and here

Reproduction steps

Just log the error. No need for an exception.

But, if it's really needed, don't use System.Exception: see #1439

Expected behavior

No exception is created just for logging.

Additional context

No response

lukebakken commented 10 months ago

Thank you @paulomorgado!

https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/169a6d1d11c1397d80fba2596edfa3f24b2878e7#r134239817

lukebakken commented 4 months ago

I just did a search for new.*Exception within the main branch and it appears that this has been resolved over the course of working on version 7.