[rabbitmq-discuss] IOExceptions and the java client api

Ben Hood 0x6e6562 at gmail.com
Fri Nov 7 12:51:57 GMT 2008


Henric,

On Fri, Nov 7, 2008 at 12:03 PM, Henric Larsson
<Henric.Larsson at igindex.co.uk> wrote:
> Furthermore, I personally think that the IOException is almost as course
> grained as declaring that all methods throws Exception - not only does this
> make for unnecessary cluttered code when using the client, all invocations
> must be wrapped in a try/catch block, but it doesn't give any real
> information about the underlying problem; Server shutdown, pipe broken,
> dodgy data on the wire.

Personally, I couldn't agree more. I think that unless somebody comes
up with a good reason why you need checked exceptions these days, I'd
like to remove them from the API.
.
> My suggestion is to have a hierarchy of unchecked exceptions with real
> meaning clearly documented in the api - giving users the option of catching
> the exceptions that can be recovered from while allowing other exceptions to
> be propagated to the caller.

This is a good point - in fact, we considered at some point in the
past as well - so we are going to revive an old bug (15786) and update
it with your suggestions.

Ben




More information about the rabbitmq-discuss mailing list