rabbitmq-dotnet-client icon indicating copy to clipboard operation
rabbitmq-dotnet-client copied to clipboard

Only throw `RabbitMQ.Client`-specific exceptions.

Open paulomorgado opened this issue 1 year ago • 3 comments

Describe the bug

From Using Standard Exception Types:

❌ DO NOT throw System.Exception or System.SystemException.

RabbitMQ code should return RabbitMQ exceptions. If there was another exception causing the one being thrown, it should be added as an InnerException.

Reproduction steps

ServiceBase.Notify is throwing System.Exception at https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/projects/RabbitMQ.Client/client/impl/SessionBase.cs#L128

Expected behavior

a RabbitMQ-specific exception is thrown.

Additional context

No response

paulomorgado avatar Dec 05 '23 16:12 paulomorgado