Code example for ExecutionException

Methods: getCause

0
            return get(); 
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new ElasticsearchIllegalStateException("Future got interrupted", e);
        } catch (ExecutionException e) {
            if (e.getCause() instanceof ElasticsearchException) {
                throw (ElasticsearchException) e.getCause();
            } else { 
                throw new TransportException("Failed execution", e);
            } 
        } 
    } 
 
    @Override 
    public V txGet(long timeout, TimeUnit unit) throws ElasticsearchException {
        try { 
            return get(timeout, unit);
        } catch (TimeoutException e) {
            throw new ElasticsearchTimeoutException(e.getMessage());
        } catch (InterruptedException e) {