zeroc-ice / ice

All-in-one solution for creating networked applications with RPC, pub/sub, server deployment, and more.
https://zeroc.com
GNU General Public License v2.0
2k stars 592 forks source link

Unnecessary catch/rethrow in RequestHandlerCache #2341

Closed pepone closed 4 days ago

pepone commented 5 days ago

This catch and rethrow of CommunicatorDestroyedException is unnecessary.

https://github.com/zeroc-ice/ice/blob/a30bc338624899c0bafa92dc88745c0dcaf73789/csharp/src/Ice/Internal/RequestHandlerCache.cs#L115-L125

bernardnormier commented 4 days ago

Here, we're (re)throwing ex when we catch a CommunicatorDestroyedException, rather than letting CommunicatorDestroyedException through.

It's not clear to me why this logic is flawed. It's likely the rethrow with throw ex is not good in C#, but we do this in many other places, even the generated code.