rabbitmq-java-client
rabbitmq-java-client copied to clipboard
Channel#abort discards exceptions which it declares as thrown
On the code below that I got from master:
/** Public API - {@inheritDoc} */ @Override public void abort(int closeCode, String closeMessage) throws IOException { try { close(closeCode, closeMessage, true, null, true); } catch (IOException _e) { /* ignored */ } catch (TimeoutException _e) { /* ignored */ } }
The method abort throw an IOException that I need to catch when calling this method. But this exception is silently discarded inside them and in the documentation is written that too. So I was suspicious that the documentation was not up to date and had to check the source to verify their validity. Wouldn't be possible to remove this throw? I am not sure with it is necessary in another classes that override this method.
This makes sense, considering the semantics mentioned in the API documentation and the consistency with Connection#abort. This is a breaking change though (code catching the IOException won't compile anymore), so it must go into 6.0.