Code example for UndeclaredThrowableException

0
                throw (RuntimeException) t;
            } 
            if (t instanceof IOException) {
                throw (IOException) t;
            } 
            throw new UndeclaredThrowableException(t);
        } 
 
        // Handling the response was successful. Ensure that the content has 
        // been fully consumed. 
        HttpEntity entity = response.getEntity();
        EntityUtils.consume(entity);
        return result;
    } 
 
}