if (future.isSuccess()) {
return future.getResponse();
} else if (future.getCause() != null) {
Throwable cause = future.getCause();
if (cause instanceof ClosedChannelException) {
throw new SmppChannelException("Channel was closed after sending request, but before receiving response", cause);
} else {
throw new UnrecoverablePduException(cause.getMessage(), cause);
}
} else if (future.isCancelled()) {
throw new RecoverablePduException("Request was cancelled");